I have a code:-

Plot[Evaluate@PDF[NormalDistribution[1.6, 0.2], x], {x, -6, 6}]

And then I got the warning: General::munfl: Exp[-721.953] is too small to represent as a normalized machine number; precision may be lost. However, if I removed Evaluate, the warning disappears. Why would that? Would that matter?

I need to keep the Evaluate, since I am drawing various distributions.

Thanks in advance!


When you use Evaluate, the PDF evaluates to an exponential:

pdf = PDF[NormalDistribution[1.6, .2], x]

1.99471 E^(-12.5 (-1.6 + x)^2)

When you evaluate this object with a large enough number x (on the order of 10), the resulting object is too small to represent as a machine number:

pdf /. x -> 10

General::munfl: Exp[-882.] is too small to represent as a normalized machine number; precision may be lost.


Let's check. The smallest machine number is:



If we convert the pdf expression to one using extended precision numbers:

epdf = SetPrecision[pdf, 20];

and then evaluate epdf at 10:

epdf /. x->10


We see that the result is much smaller than the smallest possible machine number. This is why evaluating pdf at 10 produces an error message and Mathematica returns 0.

Now, when you remove the Evaluate, then Plot only evaluates the PDF object when it is numerical, and this doesn't produce any messages:

PDF[NormalDistribution[1.6, .2], 10]


Of course, the above output is not a machine number:

Precision @ PDF[NormalDistribution[1.6, .2], 10]


If you are multiplying extremely small numbers with extremely large numbers, then setting the small numbers to zero can be an issue. In that case, it makes sense to work with extended precision numbers instead.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.