Numerical Differentiation


Forward Difference \(f'(x)\approx\frac{f(x+h)-f(x)}{h}\), which is \(O(h)\)
Cancellation should become an issue around \(O(\mathrm{eps}^{\frac{1}{2}})\approx 10^{-8}\)
Central Difference \(f'(x)\approx \frac{f(x+h)-f(x-h)}{2h}\), which is \(O(h^2)\)
Cancellation should become an issue around \(O(\mathrm{eps}^{\frac{1}{3}})\approx 10^{-5}\)
for \(f=e^x\), \(x=0\) and \(h=10^{-i}\)