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: Accuracy and Precision

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36867] RE: [mg36853] Accuracy and Precision
  • From: "DrBob" <drbob at bigfoot.com>
  • Date: Mon, 30 Sep 2002 03:03:10 -0400 (EDT)
  • Reply-to: <drbob at bigfoot.com>
  • Sender: owner-wri-mathgroup at wolfram.com

First of all, the statements

SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity]; 
SetPrecision[a, Infinity]; SetPrecision[b, Infinity];

have no effect whatsoever.

Each of them RETURNS a value of a with altered accuracy or precision
(the integer versions, in this case), but they have no effect on 'a' or
'b'.  Instead, you might use statements like

a=SetAccuracy[a,Infinity]

but that doesn't actually help with the polynomial f, because it has
machine precision coefficients.  (Try it.)

The polynomial f has very large terms but a small result, so you're
losing precision.  The issue is whether you know 'a', 'b', and the
coefficients of 'f' well enough to EARN that precision, so to speak.  If
you know that 333.75 is exactly that then, by all means, replace it with
33375/100.  Ditto for the values of 'a' and 'b'.

If you don't know the values that well, the value of f truly IS lost in
the noise, and that's nobody's fault, certainly not Mathematica's.

Bobby Treat

-----Original Message-----
From: Peter Kosta [mailto:pkosta2002 at yahoo.com] 
To: mathgroup at smc.vnet.net
Subject: [mg36867] [mg36853] Accuracy and Precision

Could someone explain what is going on here, please?

In[1]:= 
a = 77617.; b = 33096.; 

In[2]:=
SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity]; 
SetPrecision[a, Infinity]; SetPrecision[b, Infinity]; 

In[4]:=
f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 +
a/(2*b)

In[5]:=
SetAccuracy[f, Infinity]; SetPrecision[f, Infinity]; 

In[6]:=
f

Out[6]=
-1.1805916207174113*^21

In[7]:=
a = 77617; b = 33096; 

In[8]:=
g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) +
(55/10)*b^8 + a/(2*b)

In[9]:=
g

Out[9]=
-(54767/66192)

In[10]:=
N[%]

Out[10]=
-0.8273960599468214

Thanks,

PK





  • Prev by Date: Swapping Ctlr and Alt on Linux
  • Next by Date: Re: How to get a listing of currently defined symbols
  • Previous by thread: Re: Accuracy and Precision
  • Next by thread: Strange Behavior of Mathematica under Windows