Skip to main content
1 of 3

Question on accuracy and precision of NIntegrate

As a Mathematica newbie, I was testing the accuracy/precision of NIntegrate (9.0.1.0 on Mac) and have obtained a very peculiar result.

f[x_] := (1/2) PDF[NormalDistribution[-100, 1], x] 
   + (1/2) PDF[NormalDistribution[+100, 1], x]
g[n_] := NIntegrate[f[x] Log2[1/f[x]], {x, -Infinity, Infinity}, 
   AccuracyGoal -> Infinity, PrecisionGoal -> Automatic, 
   MaxRecursion -> 1000, WorkingPrecision -> n]
Plot[g[n], {n, 50, 100}]

Output

There was no error message for any value of n. How should I interpret this? I am completely confused about the notions of PrecisionGoal, AccuracyGoal, and WorkingPrecision, as Mathematica doesn't seem to follow what's written in the manual.

Is there any way I can obtain an honest error bound as in the GNU Scientific Library, so at least I know for sure what I can trust and how much?