Re: How to increase Working Precision?



On Mar 6, 7:57 am, rjf <fate...@xxxxxxxxx> wrote:
Again, I suggest you read the manual, and in particular note the
difference between the Mathematica notions of precision and accuracy.

A very precise value for pi is 3.15000000000000000000000000000000
which happens not to be very accurate.

x has a small relative error (high precision)

In[1]:= x = 3.15000000000000000000000000000000;

In[2]:= Precision[x]

Out[2]= 32.4983

But it is not a good approximation to Pi, as you can
see by subtraction:

In[3]:= d = x - Pi

Out[3]= 0.0084073464102067615373566167205

In[4]:= Precision[d]

Out[4]= 29.9247

The difference in Precision between x and d indicates that
only about 2 of the displayed digits are close to Pi.

Regarding the original question, I'm unable to reproduce the
behaviour.
Here is the result from all versions back as far as Version 4.2
on a 32 bit Linux machine.

In[1]:= Pi + 2.0

Out[1]= 5.14159

In[2]:= MachineNumberQ[%]

Out[2]= True

If you instead meant that you want all results to a fixed Precision
of 25 digits then this can be accomplished as follows:

In[1]:= Block[{$MinPrecision = 25, $MaxPrecision = 25},
x = 2.`25;
Pi + x
]

Out[1]= 5.141592653589793238462643

Note in particular that x must be defined as a software float:

x = SetPrecision[2, 25];
x = 2.`25;
etc

and not:

x = 2.

which is a machine precision number.

Mark Sofroniou
Wolfram Research
.



Relevant Pages

  • Re: How to increase Working Precision?
    ... difference between the Mathematica notions of precision and accuracy. ... It has 32 digits after the decimal point, so the absolute error is ...
    (sci.math.symbolic)
  • Re: How to increase Working Precision?
    ... difference between the Mathematica notions of precision and accuracy. ... do not correspond to Mathermatica. ...
    (sci.math.symbolic)

Loading