[Date Index]
[Thread Index]
[Author Index]
Re: //N bug, but WHY?
*To*: mathgroup at smc.vnet.net
*Subject*: [mg58648] Re: //N bug, but WHY?
*From*: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
*Date*: Tue, 12 Jul 2005 05:21:32 -0400 (EDT)
*Organization*: Uni Leipzig
*References*: <data3n$mec$1@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
Hi,
if you use N[] the expression is converted into
machine precision numbers,
these numbers have only 16 digits and if you make
calculations with
numbers that need more than 16 digits you get
errors.
Try
Block[{$MaxExtraPrecision = 1000},
(N[#1, 32] & )[Cosh[(43*Pi)/Sqrt[2]] +
(1 - Cosh[43*Sqrt[2]*Pi])*Csch[43*Sqrt[2]*Pi]*
Sinh[(43*Pi)/Sqrt[2]]]]
Regards
Jens
"symbio" <symbio at has.com> schrieb im Newsbeitrag
news:data3n$mec$1 at smc.vnet.net...
> 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,
>
Prev by Date:
**Re: //N bug, but WHY?**
Next by Date:
**Re: //N bug, but WHY?**
Previous by thread:
**Re: //N bug, but WHY?**
Next by thread:
**Re: //N bug, but WHY?**
| |