Re: Re: Zero does not Equal Zero is a feature

*To*: mathgroup at smc.vnet.net*Subject*: [mg31516] Re: [mg31443] Re: Zero does not Equal Zero is a feature*From*: Daniel Lichtblau <danl at wolfram.com>*Date*: Thu, 8 Nov 2001 04:56:09 -0500 (EST)*References*: <9rdg39$7ob$1@smc.vnet.net> <200111071029.FAA26256@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Richard Fateman wrote: > > These difficulties have been in Mathematica since > its first design, and although there have been a > number of redesigns of the arithmetic, it > retains the element of treating floating point > numbers as though they were intervals. > > Careful numerical analysis is hindered by this > design, which was intended to be used by non-careful > sloppy people. But the design has some flaws > which make it necessary for people who know > what they are doing, to re-learn a new and not > very comfortable calculus of numbers, at > least if they want to use Mathematica. It also > interferes with sloppy calculation. > > One choice of course is not to use Mathematica > for numerical calculation. There are other > arbitrary precision packages. > > Another choice is to test, and reset the > accuracy of numbers at critical points. > Realize, for example, that certain convergent > iterations will not produce more accurate > answers (as is normal), but will produce > vaguer answers at each step because of Mathematica's > arithmetic. They will terminate not when answers > are close, but when they are essentially unknown. > > > You could also complain about the arithmetic, > but that will probably not have much effect. > It is a "feature". My (1982) review of Mathematica > made some of the same observations. > Richard Fateman > www.cs.berkeley.edu/~fateman I imagine that would be 1992. Issues regarding the models of numerical computation used in Mathematica have been raised several times over the years, in particular in the news group sci.math.symbolic. In virtually all cases we have spelled out the hows and whys in responses. Rather than repeat all that I will provide URLs I located from a google search. http://groups.google.com/groups?hl=en&threadm=3A76E1B0.BF92F674%40wolfram.com&rnum=5&prev=/groups%3Fq%3DLichtblau%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D5%26selm%3D3A76E1B0.BF92F674%2540wolfram.com http://groups.google.com/groups?hl=en&threadm=3A775387.5436B99C%40wolfram.com&rnum=67&prev=/groups%3Fq%3DLichtblau%26start%3D60%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D67%26selm%3D3A775387.5436B99C%2540wolfram.com http://groups.google.com/groups?hl=en&threadm=3A785C2F.C13943C6%40wolfram.com&rnum=1&prev=/groups%3Fq%3DSofroniou%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D1%26selm%3D3A785C2F.C13943C6%2540wolfram.com http://groups.google.com/groups?q=Lichtblau&hl=en&group=sci.math.symbolic&rnum=6&selm=35C0128B.12F3997C%40wolfram.com http://groups.google.com/groups?hl=en&threadm=35E4D33B.58F0C5D0%40wolfram.com&rnum=28&prev=/groups%3Fq%3DLichtblau%26start%3D20%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D28%26selm%3D35E4D33B.58F0C5D0%2540wolfram.com http://groups.google.com/groups?hl=en&threadm=35DDB329.3B470C05%40wolfram.com&rnum=29&prev=/groups%3Fq%3DLichtblau%26start%3D20%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D29%26selm%3D35DDB329.3B470C05%2540wolfram.com http://groups.google.com/groups?hl=en&threadm=38DFAC19.A77E6208%40wolfram.com&rnum=9&prev=/groups%3Fq%3DLichtblau%26hl%3Den%26group%3Dsci.math.symbolic%26rnum%3D9%26selm%3D38DFAC19.A77E6208%2540wolfram.com Many go directly to responses by myself but it should be noted that one can easily obtain from them the entire threads (be warned that some are quite long). There are also threads in comp.soft-sys.math.mathematica on related issues which readers may search out in the archives at the URL below. http://library.wolfram.com/mathgroup/ I will address a handful of specific issues brought into question in the note above. First is perhaps a matter of opinion and also primarily of historic rather than technical interest. "These difficulties have been in Mathematica since its first design, and although there have been a number of redesigns of the arithmetic...." I am not aware of anything that might be called substantial redesign of Mathematica's numerical computation in the ten years I have been employed by Wolfram Research. The second paragraph above makes a few claims. "Careful numerical analysis is hindered by this design, which was intended to be used by non-careful sloppy people." Numerical evaluation may be used by careless and careful people alike. Significance arithmetic (the arithmetic model in question) is useful, and used, and serves a purpose. It can be misused, as can fixed precision arithmetic or virtually anything else. But it works well for many types of computation. As mentioned in some of the above-noted threads, I use it to find approximate Groebner bases, used in turn by NSolve. I quite assure you that usage is not "sloppy". There is then a claim that, I think, indicates this model will be problematic for "people who know what they are doing". Certainly it may be unfamiliar to some, especially those who do not make much use of Mathematica. But I find it implausible that experienced numerical analysts will have grave difficulties understanding the ideas behind significance arithmetic. >One choice of course is not to use Mathematica for numerical calculation. >There are other arbitrary precision packages. I honestly do not know how many support approximate arithmetic, or how heavily they are used in that realm. I would be curious to hear more about any that may be in widespread use for numerical computation. >Another choice is to test, and reset the accuracy of numbers at >critical points. In many cases one can achieve a fixed precision algorithm by the expedient of setting MinPrecision and MaxPrecision to be equal. As an example I take an iteration you and Mark Sofroniou discuss in the thread at the third URL above. In[1]:= ni[a_]:=a- (a^2-4)/(2*a) In[2]:= Nest[ni,3.00000000000000000,50] Out[2]= 2.00 In[3]:= Nest[ni,3.00000000000000000,60] 1 Out[3]= 0. 10 Mark of course explains what is happening with this example, and why. I'll just give a quick example of how one might do it in fixed precision. In[4]:= nifixed[a_] := Block[{$MinPrecision=$MaxPrecision=Precision[a]}, a- (a^2-4)/(2*a)] In[5]:= Nest[nifixed,3.00000000000000000,50] Out[5]= 2.00000000000000000 In[6]:= Nest[nifixed,3.00000000000000000,60] Out[6]= 2.00000000000000000 Several times in the past you have raised issues regarding particulars of numerical computation in Mathematica. I would like to pose some questions. Do you, in your work, encounter specific needs in numerical computation that you cannot meet with Mathematica? Getting back to mention of arbitrary precision packages, are there some you use for computations that Mathematica cannot handle? We are of course in the business of extending useful capabilities of Mathematica. Specific examples in response to the above would be of interest for such work. Daniel Lichtblau Wolfram Research

**References**:**Re: Zero does not Equal Zero is a feature***From:*Richard Fateman <fateman@cs.berkeley.edu>