Why would Evaluate[] in Plot give me warning about precision?Plot3D discrepancy between MMA 10 and 11.3 - possible small numbers issueGood practice about numerical precisionWhy is 0 vs 0.0 causing a precision problem?How can I suppress the warning $mathrmit precision may be lost$?Logarithmic contour plot floating point precision
How do I recover from a cryptocurrency scam?
How do you help a new player evaluate complex multiclassing options without driving them and yourself crazy?
Is there any benefit of being treated as "professor" by students and admin?
In C#, is there a way to enforce behavior coupling in interface methods or is the fact that I am trying to do that a design smell?
How much would we learn from observing an FTL starship fly by?
Color coding Alerts
What's the name of this windows feature?
Are these pigtails inside the panel and outside a junction box allowed?
Why the highlighted outline in animated cartoons?
Why does General Grievous say “Ah yes, the negotiator?”
How many cows would you need to drop on Mars to successfully terraform it?
Which device is violating the 802.11n Wi-Fi standard?
Was X17 predicted before it was observed?
Can you counterspell a spell if you don't know who's casting it?
Finding a solution to a linear program with a small number of zeros
Why give an android emotions?
Does a buffer overflow vulnerability always mean a code execution vulnerability?
Nested theorem label
GIMP using command line
Why is this negated with nicht and not kein?
Set and extract individual bytes of a number (lowByte() and highByte())
Chess PhD topic in machine learning?
Aliens kill as an art form, surprised that humans don't appreciate
What are the possible punishments for an impeached USA president?
Why would Evaluate[] in Plot give me warning about precision?
Plot3D discrepancy between MMA 10 and 11.3 - possible small numbers issueGood practice about numerical precisionWhy is 0 vs 0.0 causing a precision problem?How can I suppress the warning $mathrmit precision may be lost$?Logarithmic contour plot floating point precision
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;
$begingroup$
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!
plotting evaluation machine-precision precision-and-accuracy
$endgroup$
add a comment
|
$begingroup$
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!
plotting evaluation machine-precision precision-and-accuracy
$endgroup$
add a comment
|
$begingroup$
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!
plotting evaluation machine-precision precision-and-accuracy
$endgroup$
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!
plotting evaluation machine-precision precision-and-accuracy
plotting evaluation machine-precision precision-and-accuracy
asked Sep 20 at 3:39
H42H42
3,1572 silver badges13 bronze badges
3,1572 silver badges13 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
$begingroup$
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.
0.
Let's check. The smallest machine number is:
$MinMachineNumber
2.22507*10^-308
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
1.7870924971057366*10^-383
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]
1.787092497106*10^-383
Of course, the above output is not a machine number:
Precision @ PDF[NormalDistribution[1.6, .2], 10]
13.0095
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.
$endgroup$
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f206528%2fwhy-would-evaluate-in-plot-give-me-warning-about-precision%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
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.
0.
Let's check. The smallest machine number is:
$MinMachineNumber
2.22507*10^-308
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
1.7870924971057366*10^-383
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]
1.787092497106*10^-383
Of course, the above output is not a machine number:
Precision @ PDF[NormalDistribution[1.6, .2], 10]
13.0095
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.
$endgroup$
add a comment
|
$begingroup$
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.
0.
Let's check. The smallest machine number is:
$MinMachineNumber
2.22507*10^-308
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
1.7870924971057366*10^-383
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]
1.787092497106*10^-383
Of course, the above output is not a machine number:
Precision @ PDF[NormalDistribution[1.6, .2], 10]
13.0095
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.
$endgroup$
add a comment
|
$begingroup$
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.
0.
Let's check. The smallest machine number is:
$MinMachineNumber
2.22507*10^-308
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
1.7870924971057366*10^-383
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]
1.787092497106*10^-383
Of course, the above output is not a machine number:
Precision @ PDF[NormalDistribution[1.6, .2], 10]
13.0095
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.
$endgroup$
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.
0.
Let's check. The smallest machine number is:
$MinMachineNumber
2.22507*10^-308
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
1.7870924971057366*10^-383
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]
1.787092497106*10^-383
Of course, the above output is not a machine number:
Precision @ PDF[NormalDistribution[1.6, .2], 10]
13.0095
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.
answered Sep 20 at 4:10
Carl WollCarl Woll
98.1k4 gold badges133 silver badges247 bronze badges
98.1k4 gold badges133 silver badges247 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f206528%2fwhy-would-evaluate-in-plot-give-me-warning-about-precision%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown