       Re: Accuracy and Precision

• To: mathgroup at smc.vnet.net
• Subject: [mg36872] Re: Accuracy and Precision
• From: Bill Rowe <listuser at earthlink.net>
• Date: Mon, 30 Sep 2002 03:03:20 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```Neither SetAccuracy[expr,n] nor SetPrecisions[expr,n] modify expr. These functions modify the prinout not the internal representation. So, the first computation of f is done with approximate numbers and doesn't result in a correct answer due to approximate arithmetic.

By assigning a rational expression to each of the variables, you have made them exact numbers and Mathematica responds with an exact solution.

On 9/29/02 at 2:55 AM, pkosta2002 at yahoo.com (Peter Kosta) wrote:

>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: Determination of a double integral
• Next by Date: Re: Accuracy and Precision
• Previous by thread: Accuracy and Precision
• Next by thread: Re: Accuracy and Precision