This is because N[expr]
uses machine precision, without any guarantees on the number of correct digits in the result. It simply uses machine numbers (approximately 15 decimal digits) during the intermediate steps of the computation.
N[expr, n]
is different. It does not just use n
-digit numbers during computation. Instead, it tries to ensure that the result is correct to n
digits, which typically requires more than n
digits during the calculation. This warning means that the system was unable to ensure that the result is correct to as many digits as you requested, even after using 50 extra digits (the current limit) in intermediate calculations.
The failure likely has to do with the fact that the true result is zero, yet the error estimate ("number of correct digits") is relative, which is not applicable to zero. The system can't seem to decide if the result is just very small or truly zero.
Roughly speaking, in Mathematica "precision" refers to relative error and "accuracy" to absolute error. Computing absolute error is no problem with zero. We can make the error go away by requesting no n
significant digits (precision) but n
digits after to the right of the decimal point (accuracy). See N
for the syntax.
N[Log[Cos[1]^2 + Sin[1]^2], {Infinity, 10}]
(* 0.*10^-10 *)
N[Log[Cos[1]^2 + Sin[1]^2] // Simplify, 1]
$\endgroup$