       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:=
a = 77617.; b = 33096.;

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

In:=
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:=
SetAccuracy[f, Infinity]; SetPrecision[f, Infinity];

In:=
f

Out=
-1.1805916207174113*^21

In:=
a = 77617; b = 33096;

In:=
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:=
g

Out=
-(54767/66192)

In:=
N[%]

Out=
-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