RE: RE: Accuracy and Precision

*To*: mathgroup at smc.vnet.net*Subject*: [mg36989] RE: [mg36936] RE: Accuracy and Precision*From*: "DrBob" <drbob at bigfoot.com>*Date*: Fri, 4 Oct 2002 05:01:33 -0400 (EDT)*Reply-to*: <drbob at bigfoot.com>*Sender*: owner-wri-mathgroup at wolfram.com

Daniel, >>The precision/accuracy tracking mechanism will generally let you know, in some fashion, that you have no trustworthy digits. But it is up to the user to check that sort of thing. In this case Mathematica did NOT let us know, in any fashion, that we had no trustworthy digits. Precision and Accuracy outputs were completely misleading. (16 and -5 respectively.) Even Andrzej Kozlowski, who's adept in Mathematica, thought that would be meaningful, and never came up with a better way to check (other than using infinite precision for numbers that probably aren't known that exactly). Peter Kosta demonstrated that he could get a completely erroneous answer with Infinite precision. I blame the problem primarily, and I don't think there's any way to make the answer meaningful. That's not Mathematica's fault at all, and users need to be aware of that old maxim: "garbage in, garbage out". Still, if the Kernel adds 37-digit numbers with 16-digit precision and comes up with a 22-digit result, it doesn't take much sophistication to realize the answer can't have 16-digit precision. Here's an even more extreme result: f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b), 50]; a = 77617.; b = 33096.; f Precision[f] -1.180591620717411303424`71.0721*^21 71 71.0721 digits of precision? I don't think so!! We can do the following instead: x = Interval[333.75]; y = Interval[5.5]; a = Interval[77617.]; b = Interval[33096.]; x*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + y*b^8 + a/(2*b) Interval[{-4.486248158726164*^22, 4.2501298345826815*^22}] and that looks like the right answer, finally!! I like that method. However, that doesn't change the fact that Accuracy, Precision, and SetAccuracy appear to be completely useless. I haven't seen an example in which they did what anyone (but you) thought they should do. Bobby -----Original Message----- From: danl at wolfram.com [mailto:danl at wolfram.com] To: mathgroup at smc.vnet.net Subject: [mg36989] Re: [mg36936] RE: Accuracy and Precision DrBob wrote: > > I think I'd prefer that Mathematica gave me a clue -- without being > asked explicitly in JUST the right way that only you know and had > forgotten -- that there's a precision problem. > > Oddly enough, when you DO ask it nicely, you get error messages, but if > you're not aware there's a problem, it lets you go on your merry way, > working with noise. > > Bobby Mathematica is not a mind reader. But the evaluation sequence, while complicated, is reasonably well documented. If you perform machine arithmetic, or for that matter significance arithmetic, and there is massive cancellation error, no use of SetAccuracy after the fact will fix it. The precision/accuracy tracking mechanism will generally let you know, in some fashion, that you have no trustworthy digits. But it is up to the user to check that sort of thing. It is not obvious to me what sort of "error" the software might notice to report. If you have a concise example of input, and expected output, I can look further. I've not seen anything in this thread that struck me as a failure of the software to warn the user, but maybe I missed something. Daniel

**Follow-Ups**:**Re: RE: RE: Accuracy and Precision***From:*Daniel Lichtblau <danl@wolfram.com>