       Re: Precision issues

• To: mathgroup at smc.vnet.net
• Subject: [mg73516] Re: Precision issues
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 21 Feb 2007 01:39:06 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK
• References: <erelv2\$7ol\$1@smc.vnet.net>

```mickey wrote:
> Hi,
>
> I am calculating certain integrals numerically and get back a number.
> Now, is it possible to determine how many digits is that answer accurate
> to?
>
> E.g.,
>
> NIntegrate[ Exp[-p^2 - q^2], {p, 0, 10}, {q, 0, 10}, Method ->
>      MonteCarlo, MaxPoints -> 1000000]
>
> Gives,
>
> 0.791249
>
> How many digits is this answer accurate to?

You are using machine-precision numbers; therefore you cannot know
since, "Machine numbers, [...], always contain the same number of
digits, and maintain no information on their precision. "

In:=
sol = NIntegrate[Exp[-p^2 - q^2], {p, 0, 10},
{q, 0, 10}, Method -> MonteCarlo,
MaxPoints -> 1000000]

Out=
0.7912492023745136

In:=
Precision[sol]

Out=
MachinePrecision

If you desire to be guarantee a specific level of precision, or at least
to know when Mahtematica failed to reach the desired precision, you must
use arbitrary-precision numbers. See the options PrcecisionGoal and

Regards,
Jean-Marc

 " The Mathematica Book Online  /  Advanced Mathematics in
Mathematica  /  Numbers  /  3.1.4 Numerical Precision"
http://documents.wolfram.com/mathematica/book/section-3.1.4

```

• Prev by Date: Re: FullGraphics question
• Next by Date: LogPlot and Epilog
• Previous by thread: Re: Precision issues
• Next by thread: Re: Precision issues