This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

WorkingPrecision

WorkingPrecision
is an option for various numerical operations that specifies how many digits of precision should be maintained in internal computations.
  • Setting WorkingPrecision->n causes all internal computations to be done to at most n-digit precision.
  • Even if internal computations are done to n-digit precision, the final results you get may have much lower precision.
Find a root using 60-digit precision arithmetic:
Solve a differential equation using 24-digit precision arithmetic:
Find a root using 60-digit precision arithmetic:
In[1]:=
Click for copyable input
Out[1]=
 
Solve a differential equation using 24-digit precision arithmetic:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Evaluate the function using 24-digit precision arithmetic:
Without higher precision you see mainly numerical roundoff error:
Approximate an integral using 24-digit precision arithmetic:
The PrecisionGoal is automatically increased to be 10 less than the working precision:
Find a minimum of a function, adaptively increasing the precision up to 50 digits:
The PrecisionGoal and AccuracyGoal are automatically set to be half the final precision:
Solve a differential equation with 32-digit precision arithmetic:
The PrecisionGoal and AccuracyGoal are set to be half of the working precision:
Using InterpolationOrder->All will reduce the errors between steps:
Check the quality of a solution to Duffing's equation by using a sequence of solution precisions:
Make a sequence of solutions at successively higher working precision:
A plot shows that some of the solutions deviate toward the end:
Plot the solution as a function of working precision:
Convergence to the solution at the highest precision indicates about 6 digits can be trusted:
Low-precision parameters in functions may invalidate the use of higher-precision arithmetic:
The result is a poor approximation to :
Use of exact parameters allows comparison at different precisions:
Expect solution times to increase exponentially as a function of working precision:
A log plot of the computation time as a function of working precision:
New in 1 | Last modified in 5