# Bug? Numerical calculation error with FullSimplify and arbitrary precision

Bug introduced after 5.2, fixed in 8.0, reintroduced in 9.0 and persisting through 12.3

Is this a bug?

If I do

FullSimplify[n E^(010 n)]


then it returns

n/2


which is obviously incorrect.

(I've simplified the example, following a comment.)

[Mathematica Version 10.3.1.0]

• A wild guess: Since the -1.10 in a, b, and nb are independent, the quotient has a great deal of uncertainty in nb/a, represented by 09.698970004336022. Consider Plot[MinMax[1.10.*2.10.^(Interval[09.698970004336022] n) n ]/ n, {n, -10^10, 10^10}]. But I don't understand the 1/2 for a point estimate of the coefficient, or why b/a is presented as an exact result. Note that a/a is not 1 exactly. Mar 10, 2017 at 11:49
• Simpler example: FullSimplify[n E^(0100. n) ], Series[n E^(0100. n) , {n, 0, 0}]. The accuracy 100. does not seem to matter, big or small, positive or negative. Mar 10, 2017 at 12:47
• I don't see how this isn't a bug. n/2 just isn't correct. Can you please contact Wolfram Support and let us know what they said? Mar 12, 2017 at 10:39
• With versions 5.2 and 8.0.4 I get E^(0.*10^-10 n) n as the output (with InputForm being E^(010.*n)*n). So the bug was introduced in version 9.0. Mar 12, 2017 at 14:58
• Sorry to say, but with version 7.0.1 on Win7x64 I get n/2. Incredible. Mar 12, 2017 at 17:19

I think I've traced down the problem. It hinges on two things. An identity:

Cosh[x] == Sinh[2 x]/(2 Sinh[x]) // Simplify
(*  True  *)


And a questionable auto-simplification:

Csch[010. n] Sinh[2 010. n]
(*  1  *)

{Csch[010. n], Sinh[2 010. n]} // FullForm
(*  List[Csch[Times[010.,n]],Sinh[Times[09.698970004336019,n]]]  *)


(The coefficients are equal, so I guess that's why they are treated as identical.)

Here are the steps in which these problems arise:

n Exp@(010 n) // ExpToTrig
(*  n (Cosh[0.*10^-10 n] + Sinh[0.*10^-10 n])  *)

n (Cosh[010. n] + Sinh[010. n]) //. SimplifyDumpCosToSinRules
(*  n (1/2 + Sinh[0.*10^-10 n])  *)

Sinh[010. n] // FullSimplify
(*  0  *)


The simplified expression is already wrong in the second step, in which the identity is applied. The last step is questionable, too, but understandable. It's what leads to n/2 as the answer.

I, for one, feel I understand why this bug has persisted.

Maybe the best workaround is to flush all "underflowed" arbitrary-precision numbers to exact 0:

FullSimplify[n E^(010 n) /. z_ /; z == 0 :> 0]
(*  n  *)