Re: Re: Numerical Problem

*To*: mathgroup at smc.vnet.net*Subject*: [mg107062] Re: [mg107044] Re: Numerical Problem*From*: Richard Fateman <fateman at cs.berkeley.edu>*Date*: Tue, 2 Feb 2010 03:25:08 -0500 (EST)*References*: <201001291249.HAA29176@smc.vnet.net> <4B6318FC.3020402@wolfram.com> <hk17nr$oja$1@smc.vnet.net> <201002011113.GAA22665@smc.vnet.net> <7414ba0d1002010448i4ce34b3cs1ef8a710763509ec@mail.gmail.com>

Mark McClure wrote: > On Mon, Feb 1, 2010 at 6:13 AM, Richard Fateman <fateman at cs.berkeley.edu> wrote: > >> Thanks, Tony, for providing a nice example of how arithmetic matters. >> Your 3-line program got pretty plausible results in version 5.0 >> ... >> But apparently not in version 7, where DanL suggests that Intel's >> numerical library may have sent it off in the wrong direction. >> > > I cannot reproduce these results on my MacBook Pro, i.e. I get (on V7 > and V5.2) the same erroneous results that Tony gets with V7. I > suppose this supports Dan's suggestion that this is a hardware issue. > I think it is not hardware, but that version 5 somehow used higher precision. It may be that it used extended-double, supported partly in hardware. The results on version 7 are the same as you get from executing the specified calculations in double precision using other programming languages. ... > > I haven't examined the equations closely but, as I understand it, they > arise via Euler's method applied to a stiff system. Thus, I would > expect numerical instability. Yes > I would also expect the iterates to > lose significance, which is exactly what we see. Yes, and eventually Mathematica produces nothing but noise. The exact answer, written out to 40 decimal digits is ([7.3708196966710360351173828125e-1],[-3.68540984833551801755869140625e-1]) In fact, carrying 40 digits of precision is enough to compute this result as ([7.370783.....e-1],[-3.68537...e-1])] > Seems to be a good > example of significance arithmetic doing exactly what we want. > Mathematica's version of arithmetic thinks that it has lost 5 or 6 extra decimal digits. (In fact claims to have lost all of them.) So in one sense if the user gets to look at the output and notices 0.10^-1 or some such thing, and knows how to interpret that, yes, that would be good; significance arithmetic has given a warning, albeit overly cautious. (Other ways of estimating or bounding the accumulated error in the iteration would require more thought.) But if the user does not look at the output but merely has a program compare this result to 0, then the result would be, why yes! your answer IS zero! or possibly why yes! your answer is 1! Maybe even both! This is a hazard, and I wonder if this is exactly what people want. And again, just doing 40 decimal digits (maybe 135 bit floating-point fraction) you can get a pretty good answer, even in Mathematica, except that Mathematica will tell you it can't. Just insert the occasional SetPrecision. RJF

**Follow-Ups**:**Re: Re: Re: Numerical Problem***From:*Andrzej Kozlowski <akozlowski@gmail.com>

**References**:**Re: Numerical Problem***From:*Richard Fateman <fateman@cs.berkeley.edu>

**Re: What does & mean?**

**Re: What does & mean?**

**Re: Numerical Problem**

**Re: Re: Re: Numerical Problem**