Suppose we plot
Plot[Exp[x] Exp[-x], {x, 0, 1000}]
This equals $1$, as expected, until around $x = 750$ where the curve drops sharply to $0$. Clearly this is due to precision / accuracy issues. How do you fix this plot?
The obvious algebraic simplification here is not the point, as my actual example is closer to:
Plot[Exp[-x^2] Hypergeometric1F1[1/3, 1/2, x^2], {x, 0, 40}]
which fails around $x = 27$, where it drops abruptly to $0$. The Exp
and Hypergeometric1F1
terms respectively shrink and grow extremely rapidly, but nearly cancel one another, so their product should remain close to $1$.