Numerical differentiation by finite differences is an inherently ill-conditioned operation in which two antagonistic error sources, truncation and round-off, govern the attainable accuracy. The objective of this study is to quantify this trade-off and to determine the step size that minimises the total error of the centred finite-difference operator. Using the smooth test function f(x) = -0.1x4 - 0.15x3 - 0.5x2 - 0.25x + 1.2 evaluated at x0 = 0.5, the first derivative was approximated for step sizes from 100 to 10-10 in IEEE-754 double precision, and the true, truncation, round-off, and total errors were measured and compared with a Taylor-series error model. The results reproduce the characteristic U-shaped error curve: truncation dominates for large h with second-order slope, round-off dominates for small h with slope minus one, and the minimum true error of 5.42x10-12 occurs at h = 10-6, in close agreement with the analytical optimum hopt = (3ε|f|/M3)1/3. The centred scheme is shown to be markedly more accurate than the forward scheme. The study concludes that an a-priori optimal step size can be reliably predicted, providing practical guidance for derivative-based engineering computation.
Copyrights © 2026