       Re: Accuracy and Precision

• To: mathgroup at smc.vnet.net
• Subject: [mg36870] Re: Accuracy and Precision
• From: "Allan Hayes" <hay at haystack.demon.co.uk>
• Date: Mon, 30 Sep 2002 03:03:15 -0400 (EDT)
• References: <an68le\$tb\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Peter,
I hope that the following example will help - it is a matter or when things
evaluate.
The a in SetAccuracy[a, Infinity], below, evaluates before SetAccuracy acts,
so we get
SetAccuracy[2.3, Infinity]. The value of a is not changed.

a = 2.3;
aa = SetAccuracy[a, Infinity]

2589569785738035/1125899906842624

But,

a

2.3

Whereas

aa

2589569785738035/1125899906842624

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Peter Kosta" <pkosta2002 at yahoo.com> wrote in message
news:an68le\$tb\$1 at smc.vnet.net...
> 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: Re: Accuracy and Precision
• Next by Date: Re: Accuracy and Precision
• Previous by thread: Re: Accuracy and Precision
• Next by thread: Re: Accuracy and Precision