Re: terrible bug in Mathematica (//N), but why????



Dear Richard,
can you explain how such huge error occurs if FullSimplify is not used? one
case gives x10^25, the other with fullsimplify gives x10^-41 (or almost
zero). Does this mean that fullsimplify should be applied to ALL numeric
calculations before //N evaluate is applied? It seems very random,
specially if you change the m and n from 43 to 44 or 42, you don't get that
error!! how do you explain that?

rgds,

"Richard Fateman" <fateman@xxxxxxxxxxxxxxx> wrote in message
news:%xhAe.228$_%4.24@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> N does numerical evaluation to double precision, not magic.
>
> After FullSimplify, all you compute is
> Sech[43*Pi/Sqrt[2]] and get 6.5 x 10^-42.
>
> Without FullSimplify, you are computing something that requires
> far more than 16 decimal digits of precision to get right.
>
> Your claim that you were using "two exact same expressions"
> is not true, and that is why you got two different answers.
> The inputs were equivalent mathematically, but not the same numerically.
>
> 10^400*( 1-sin(x)^2-cos(x)^2) is equivalent to zero, but it
> is not the "exact same expression". In particular, under
> numerical evaluation, an error in the
> sin() or cos() by even 1 bit may be magnified to a huge error.
>
> There are probably terrible bugs in Mathematica, and maybe
> even in its //N facility, but this does not look like one of them.
>
> RJF
>
>
>
>
>
> symbio wrote:
>> Evaluating (using //N) two exact same expressions, gives wrong answer
>> unless
>> fullsimplify is used first, I spent 2 days on a problem thinking my
>> answer
>> was wrong, but turned out Mathematica 5 was giving me buggy answers, I
>> debugged it to this point, but WHY in the world is this happening?
>> Please
>> help!!!
>>
>> cut and paste below to see the test case:
>>
>> In[243]:=
>> \!\(\(Cosh[\(43\ \[Pi]\)\/\@2] + \((1 - Cosh[43\ \@2\ \[Pi]])\)\ Csch[
>> 43\ \@2\ \[Pi]]\ Sinh[\(43\ \[Pi]\)\/\@2] // FullSimplify\)
>> //
>> N\[IndentingNewLine]
>> Cosh[\(43\ \[Pi]\)\/\@2] + \((1 - Cosh[43\ \@2\ \[Pi]])\)\ Csch[
>> 43\ \@2\ \[Pi]]\ Sinh[\(43\ \[Pi]\)\/\@2] // N\)
>> Out[243]=
>> \!\(6.551787517854307`*^-42\)
>> Out[244]=
>> \!\(\(-1.9342813113834067`*^25\)\)
>>
>>
>>
>> thanks,
>>
>>
>>

.



Relevant Pages

  • Re: terrible bug in Mathematica (//N), but why????
    ... Without FullSimplify, you are computing something that requires ... far more than 16 decimal digits of precision to get right. ... In particular, under numerical evaluation, an error in the sinor cosby even 1 bit may be magnified to a huge error. ... was wrong, but turned out Mathematica 5 was giving me buggy answers, I ...
    (sci.math.symbolic)
  • Re: mathematica too CLEVER in Bessel function integration?
    ... > I tried, in mathematica 5.1, to integrate ... > and obtained only after FullSimplify[] ... ... hypergeometric function is that reading off the coefficient of x^ ... A third advantage is that computing derivatives is simpler. ...
    (sci.math.symbolic)
  • terrible bug in Mathematica (//N), but why????
    ... Evaluating two exact same expressions, ... fullsimplify is used first, I spent 2 days on a problem thinking my answer ...
    (sci.math.symbolic)
  • terrible mathematica bug ( //N ) but WHY??
    ... Evaluating two exact same expressions, ... fullsimplify is used first, I spent 2 days on a problem thinking my answer ...
    (sci.math.num-analysis)
  • baffled by //N bug in mathematica, WHY?
    ... Evaluating two exact same expressions, ... fullsimplify is used first, I spent 2 days on a problem thinking my answer ...
    (sci.math)