Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RE: RE: Accuracy and Precision

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37003] Re: [mg36989] RE: [mg36936] RE: Accuracy and Precision
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Sun, 6 Oct 2002 05:32:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On Friday, October 4, 2002, at 06:01 PM, DrBob wrote:

> 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!!

Either I am it altogether or you are just simply beating to death the 
point that in case of machine arithmetic (only!)  Precision and 
Accuracy are purely formal and essentially meaningless.
One can argue whether in this case there is any point of returning any 
value for Precision, or Accuracy (like 71 above, or -5 for Accuracy in 
the example that fooled me), but it's not a big deal and it most 
certainly does not make SetPrecision meaningless. On the contrary, 
SetPrecision is very useful and in fact it is SetPrecision that can 
tell you that the answer above is meaningless:

In[8]:=
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=SetPrecision[77617.,$MachinePrecision];  b = SetPrecision[
           33096.,$MachinePrecision];


In[10]:=
{f,Precision[f]}


Out[10]=
{1.19801754103509`0*^19, 0}

I would say this is correct and show that SetPrecision is very useful 
indeed. It tells you (what of course you ought to already know in this 
case anyway) that machine precision will not give you a realiable 
answer in this case. If you know your numbers with a great deal of 
accuracy you can get an accurate answer:

In[24]:=
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), 100];
a=SetPrecision[77617.,100];  b = SetPrecision[33096.,100];


In[26]:=
{f, Precision[f]}

Out[26]=
{-0.82739605994682136814116509547981629199903311578438481991\
781484167246798617832`61.2597, 61}

Again you can be pretty sure that you got an accurate answer, provided 
of course your original setting of precision was valid.

Honestly, to say that SetPrecision and SetAccuaracy are useless is one 
of the silliest thing I have read on this list in years.


>
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/



  • Prev by Date: Re: Re: Accuracy and Precision
  • Next by Date: Re: Re: Accuracy and Precision
  • Previous by thread: Re: Re: Accuracy and Precision
  • Next by thread: RE: RE: RE: Accuracy and Precision