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][1]

The correct value, which cannot be calculated analytically, should be around 3.0471. There was no error message for any value of n.

I am not interested in calculating this specific integral, but I am curious whether there is any way I can trust the numerical value Mathematica returns. In comparison, the GNU Scientific Library gives me an error bound (although it uses machine floating point numbers, which can be another source of trouble).


  [1]: https://i.sstatic.net/LfN8P.png