A robot simulation or calibration model may provide a smooth function while its derivative is estimated from nearby function values. The numerical difference formula introduces a truncation error even when those values are exact and noise-free.
Using samples on both sides of the evaluation point can cancel a leading term that remains in a one-sided formula. That cancellation explains different step-size convergence rates; it is separate from the amplification of measurement noise in sampled position data.
The original polynomial below makes both errors exact. It is not a sensor trace, control-loop setting, or executed differentiation-library result.
Define the derivative and the two approximations
Let f be a smooth scalar function of a dimensionless coordinate x. For positive step h, define the forward approximation at x as F_h = [f(x + h) − f(x)]/h.
Define the centered approximation at that same x as C_h = [f(x + h) − f(x − h)]/(2h). The centered expression uses a total sample span of 2h, while the forward expression uses span h.
Both are labeled as approximations to f'(x). The evaluation point must stay fixed when comparing their errors. A quotient can have a different interpretation if it is instead assigned to the interval midpoint.
The FNC author textbook defines finite-difference formulas and their orders. SciPy's derivative documentation describes numerical finite differences with selectable order and direction. The elementary formulas here are explicitly chosen, rather than claimed to match that API's higher-order adaptive defaults.
Expose the leading terms
Taylor expansion gives f(x + h) = f(x) + h f'(x) + h² f''(x)/2 + h³ times the third derivative at x divided by six, plus higher-order terms when the required derivatives exist.
The forward formula therefore gives F_h = f'(x) + h f''(x)/2 + h² times the third derivative at x divided by six, plus higher-order terms. Its leading truncation contribution is generally proportional to h.
For f(x − h), the odd-power terms reverse sign while the even-power terms do not. Subtracting the two expansions cancels the constant and second-derivative terms.
Dividing by 2h gives C_h = f'(x) + h² times the third derivative at x divided by six, plus higher-order terms. Its leading contribution is generally proportional to h².
The word generally matters. A particular derivative can vanish at a chosen point, eliminating a leading term. An observed exceptional result for one function does not change the order definition for a broader smooth-function class.
Use an original cubic model
Choose f(x) = x³ + 2x² − x + 1 and evaluate its derivative at x = 2. The exact derivative is 3x² + 4x − 1, giving f'(2) = 19.
At that point, f''(2) = 6 times 2 plus 4 = 16, and the third derivative is six everywhere. Because the function is cubic, the expansions terminate and the errors below have no omitted higher-degree terms.
The forward result is exactly F_h = 19 + 8h + h². The centered result is exactly C_h = 19 + h².
At h = 0.2, the forward approximation is 20.64, with signed error 1.64. The centered approximation is 19.04, with signed error 0.04.
At h = 0.1, the forward result is 19.81, error 0.81, while the centered result is 19.01, error 0.01.
Halving the step has divided the centered error by four exactly. The forward error ratio is 1.64/0.81, approximately 2.024691, close to the factor two associated with its leading term.
A second halving distinguishes asymptotic behavior
At h = 0.05, the forward error is 0.4025 and the centered error is 0.0025. The next forward error ratio is 0.81/0.4025, approximately 2.012422, moving closer to two.
The forward formula contains both an 8h term and an h² term. Its ratio consequently need not equal two at every finite step, even though the leading term is first order as h approaches zero.
The centered cubic example contains only h² error, so its factor-four ratio is exact for all these positive steps in exact arithmetic. That is a property of this chosen polynomial, not a universal finite-step ratio for every smooth model.
Equal sample spans are another comparison
The preceding table gave both formulas the same one-sided step h, so the centered formula used a wider total span. To compare equal spans of length h, use centered points x − h/2 and x + h/2 instead.
For this cubic, their centered error is (h/2)² = h²/4. The forward formula still has error 8h + h² when evaluated at the left endpoint x.
That statement retains the common derivative location explicitly. Comparing a forward quotient at one endpoint with a centered quotient at a different midpoint would also change the target derivative and should be labeled accordingly.
Availability and arithmetic set practical limits
A centered formula requires access to both sides of x. Near a model's domain boundary, one of those values may be unavailable. In an online time record, a future sample may not yet exist. Choosing a one-sided stencil can therefore reflect an availability constraint rather than an oversight.
Finite precision supplies another limitation. Subtracting nearby computed function values can lose significant digits, and dividing by a very small h can magnify numerical evaluation errors. SciPy's documentation notes that continued step reduction eventually stops improving accuracy under finite precision.
None of the exact polynomial calculations selects an optimal floating-point step or a sensor sampling interval. Those depend on the function evaluation and error model. They establish the narrower truncation relationship for the formulas that were declared.
For robot numerical-model records, retain the derivative location, stencil, step, available domain, and arithmetic assumptions. The original cubic then explains why a centered stencil removes one leading error term without treating smaller steps or a named library as an automatic guarantee of accuracy.
Sources checked October 24, 2026
Fundamentals of Numerical Computation, Finite differences, author textbook web edition:
https://fncbook.com/finitediffs/
SciPy 1.16.2, scipy.differentiate.derivative:
https://docs.scipy.org/doc/scipy-1.16.2/reference/generated/scipy.differentiate.derivative.html
All functions, points, and step comparisons are original hypothetical calculations. No numerical differentiation library was executed.
Illustration note: A generic robot-and-computer scene is a concept illustration. It does not show a measured derivative, recorded motion, or verified numerical solver performance.