Re: terrible bug in Mathematica (//N), but why????
- From: "symbio" <symbio@xxxxxxx>
- Date: Sun, 10 Jul 2005 23:45:07 GMT
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,
>>
>>
>>
.
- Follow-Ups:
- Re: terrible bug in Mathematica (//N), but why????
- From: Richard Fateman
- Re: terrible bug in Mathematica (//N), but why????
- References:
- terrible bug in Mathematica (//N), but why????
- From: symbio
- Re: terrible bug in Mathematica (//N), but why????
- From: Richard Fateman
- terrible bug in Mathematica (//N), but why????
- Prev by Date: Re: terrible bug in Mathematica (//N), but why????
- Next by Date: Re: terrible bug in Mathematica (//N), but why????
- Previous by thread: Re: terrible bug in Mathematica (//N), but why????
- Next by thread: Re: terrible bug in Mathematica (//N), but why????
- Index(es):
Relevant Pages
|
|