Skip to content
Quantoros

Why does making a finite-difference step extremely small sometimes worsen a derivative estimate?

MathematicsLevel: IntermediateDerivative and probability numerics

Why does making a finite-difference step extremely small sometimes worsen a derivative estimate?

Hints
  • Consider f(x+h)−f(x).
  • Floating-point precision is finite.

Answer

Subtracting nearly equal function values amplifies rounding error. Step size balances truncation error against cancellation; smaller is not always more accurate.

Source and licence: SciPy — numerical differentiation · BSD-3-Clause · answer: Quantoros editorial

Related questions