What's the minimum step size that can be used in Euler's method before it becomes unreliable?

In particular, if Euler's method is implemented on a computer, what's the minimum step size that can be used before rounding errors cause the Euler approximations to become completely unreliable?

I presume it's when step size reaches the machine epsilon? E.g. if machine epsilon is e-16, then once step size is roughly e-16, the Euler approximations are unreliable.

• Crossposted (on recommendation) from math.stackexchange.com/q/3188019/115115, there with answers. Apr 15, 2019 at 7:01
• It is possible to give a general qualitative answer which explains why $h = O(\sqrt{\epsilon})$ is optimal. This would be an extension of the answer Lutz provided you earlier. Under very general assumptions, it is possible to determine numerically if further reduction of the current stepsize is worthwhile. However, this would be a rather long answer. You can get a taste of the relevant material by reading this answer to a related question. Apr 16, 2019 at 21:47
• I'm voting to close this question cross post with this Apr 19, 2019 at 14:48

You can do this computationally for both one-sides (first order similar to Euler) and center (second order) differences easily using the code below. Basically the error due to floating point takes over much sooner than machine epsilon would suggest even for double precision. The case is even worse for single precision of course (you can change the below code by changing the delta_x line to delta_x = numpy.logspace(-17, 1.0, 100, dtype=numpy.float16).

import numpy
import matplotlib.pyplot as plt

delta_x = numpy.logspace(-17, 1.0, 100)
x = 1.0
f_hat_1 = (numpy.exp(x + delta_x) - numpy.exp(x)) / (delta_x)
f_hat_2 = (numpy.exp(x + delta_x) - numpy.exp(x - delta_x)) / (2.0 * delta_x)

fig = plt.figure()
axes.set_xlabel("$$\Delta x$$")