12
$\begingroup$

I was playing around with Vitaliy Kaurov's neat answer to this question, and found something a bit unusual:

In[1]:= formula = 0.006101617526907695` + E^-(-7.` + x)^2 + 
           E^(-1.0000502772595525` (4.899999190832501` + x)^2) - 
           0.002006784176061687` x^2;

In[2]:= formula // FullSimplify
Out[2]= 0.00610162 - 0.00200678 x^2

Wait, what?

In[3]:= FullSimplify[E^-(-7.` + x)^2 + 
           E^(-1.0000502772595525` (4.899999190832501` + x)^2)]
Out[3]= 0.

I have to say this is not the result I expected at all.

In[4]:= FullSimplify[E^-(-7.` + x)^2]
Out[4]= 0.

In[5]:= FullSimplify[E^(-1.0000502772595525` (4.899999190832501` + x)^2)]
Out[5]= 0.

Well, at least it gets points for consistency.

In[6]:= FullSimplify[E^-(-7.` + x)]
Out[6]= 1096.63 E^-x

In[7]:= FullSimplify[E^-(-7.` + x)^3]
Out[7]= E^(-1. (-7. + x)^3)

In[8]:= FullSimplify[E^-(-7.` + x)^2.]
Out[8]= E^-(-7. + x)^2.

In[9]:= FullSimplify[E^-(-1.` + x)^2]
Out[9]= E^(-1. (-1. + x)^2)

In[10]:= FullSimplify[E^-(5.` + x)^2]
Out[10]= 0.

I gotta say, the last one was sort of a relief. Just to be sure, I'll plot something I never expected to plot:

Plot[{Boole[FullSimplify[E^(-(y + x)^2)] === 0.]}, {y, -7, 7}]

my mind is blown

FWIW, this is Mathematica 10.3.

$\endgroup$
  • 2
    $\begingroup$ Same results on V9 for your ... ehemm .... relief $\endgroup$ – Dr. belisarius Oct 30 '15 at 16:41
  • 1
    $\begingroup$ It behaves more as you might expect if you use rationals, i.e., FullSimplify[E^-(5 + x)^2] $\endgroup$ – bill s Oct 30 '15 at 16:56
  • $\begingroup$ This does not happen in V8.0.1 in OSX 10.10.5. It does happen in V10.0 in OSX 10.10.5 $\endgroup$ – march Oct 30 '15 at 17:17
  • 1
    $\begingroup$ Nasty, this. Did you report this to WRI support? $\endgroup$ – Sjoerd C. de Vries Oct 30 '15 at 17:41
  • $\begingroup$ @Szabolcs Why not a duplicate? It's the same situation, the lucky transformation is TrigExpand /@ ExpandAll /@ ExpToTrig[expr]. $\endgroup$ – ilian Oct 30 '15 at 18:31