I am trying to plot a very simple function f[x_]:=Exp[-x]/x on a log-log scale like this
LogLogPlot[f[x], {x, 10^(-5), 10^7}]

The problem is that for large values of x the plot suddenly jumps to 1 instead of going to zero as it should. I have tried to tabulate the values and increase working precision but it doesn't go away. The problem does not appear if I use
LogLogPlot[Exp[-x]/x, {x, 10^(-5), 10^7}]

Anyone can explain me what is happening?




WorkingPrecision -> 20if you're getting runaway errors from machine precision. But in this case using that option in v9 gives incorrect results. – Szabolcs Feb 26 '14 at 16:55WorkingPrecision. Then I tried it and, in v9 on OSX at least, it goes to 1 regardless how highWorkingPrecisionis. – gpap Feb 26 '14 at 16:59LogLogPlot[Evaluate@f[x], {x, 10^(-5), 10^7}]– Michael E2 Feb 26 '14 at 22:17f[x]exceeds$MinMachineNumber. See also http://mathematica.stackexchange.com/q/42093 SettingSetSystemOptions["CatchMachineUnderflow" -> False]fixes the plot (but creates other problems). There's a safer way, but I don't have time right now to answer. – Michael E2 Feb 27 '14 at 18:15