I'm having some troubles with the following code I wrote in MMA 10 some time ago:
Clear[g, a, b, c, amp]
g[x_] := I (2 Sqrt[E])/(Pi*b) Exp[-(x - c/2)^2/(2 b^2)] Exp[I (2 Pi)/a (x)] (x - c/2);
amp[x_, k_] = Integrate[-I*g[xd] Exp[-I k xd ], {xd, 0, x}];
Plot3D[
Abs[5 amp[x, k*50 + shift] /. {a -> 0.01, c -> 1, b -> 1/8,
shift -> 2 Pi/0.01}],
{x, 0, 1}, {k, -1, 1},
PlotRange -> {{0, 1}, {-1, 1}, {0, 1}},
LabelStyle -> {24, Black},
BoxStyle -> Black,
TicksStyle -> Black,
PlotPoints -> 50,
ImageSize -> 500]
The output in MMA 10 looks like the following plot:
However, in MMA 11.3 I get this error message and this output plot:
General::munfl: Exp[-5704.68-289.16 I] is too small to represent as a normalized machine number; precision may be lost.
General::munfl: Exp[-5704.68-289.16 I] is too small to represent as a normalized machine number; precision may be lost.
It looks like a precision problem, but setting WorkingPrecision to different values doesn't help. I'm sure I've read something about it on stackexchange, but I can't remember where (it might be something related to the fact that MMA 11.3 doesn't work with arbitrary precision automatically, but I might be talking nonsense...)
General::munfl
much more often than the version before... $\endgroup$WorkingPrecision
will work if you replace the0.01
with exact versions. $\endgroup$Plot3D[Evaluate[Rationalize[.., 0]], ..]
$\endgroup$