The last five lines of this code should give the same numerical result, but they don't.
z[n_, c_] := If[n > 1, z[n - 1, c]^2 + c, c];
expr = (z[6, c] - z[5, c])*c^-6;
b = Solve[expr == 0, c];
dz5 = D[z[5, c], c] /. b[[2]];
ans1 = dz5 // Expand // N
ans2 = dz5 // Simplify // N
ans3 = dz5 // N
ans4 = dz5 // Expand // Simplify // N
ans5 = dz5 // Expand // FullSimplify // N
(* -7.73335 -7.73335 -7.73335 0. -7.73335*)
It's only the specific combination of Expand and Simplify that give a strage result. Is this a bug? Or is a numerics quirk I don't understand?
RootReduce[dz5]first? In any event, ponder on the result ofN[Apply[List, Numerator[dz5 // Expand // Simplify]/256]]. – J. M.'s missing motivation Aug 15 '16 at 12:47Simplifyet al, you see a structural breakdown into computations that involve basic arithmetic and root extraction. From there is is not so difficult to applyN[]to pieces and find out that some involve huge cancellation error. Also at that point, once the structure of the expression is made, it really becomes Mathematica-independent at least so far as double precision floating point arithmetic is concerned. – Daniel Lichtblau Aug 16 '16 at 14:23RootReduce. It does not always give a "simplification", and it might be slow (but typically so isFullSimplify). Whatever else though, aRootobject tends to be good for stability of numeric evaluation. – Daniel Lichtblau Aug 16 '16 at 16:31