Numerical Errors and Error Propagation

Numerical errors and error propagation explain why a computed answer can differ from its target even when a program follows its instructions correctly. You need to identify where an error enters, measure its size, and assess how later calculations amplify it. These habits connect accuracy, limits, and approximations without requiring every calculation to be exact.

Measuring a discrepancy

Let xx be a reference value and x^\hat{x} its approximation. The signed error records direction; its magnitude records absolute error:


e=x^−x,Eabs=∣x^−x∣.e=\hat{x}-x,\qquad E_{\mathrm{abs}}=|\hat{x}-x|.


Absolute error has the same units as the quantity. To judge the discrepancy relative to the reference scale, use


Erel=∣x^−x∣∣x∣,E%=100Erel%.E_{\mathrm{rel}}=\frac{|\hat{x}-x|}{|x|},\qquad E_{\%}=100E_{\mathrm{rel}}\%.


Relative error is dimensionless and is undefined when the reference is zero. Near zero, it can be large even when the absolute discrepancy is small. Use the reference value in the denominator when calculating true relative error. If the reference is unknown, a comparison between successive approximations is an error indicator, not automatically the true error.

Where numerical errors enter

A round-off error arises when a number or arithmetic result is replaced by a representable value in finite precision. In floating-point arithmetic, some inputs cannot be stored exactly, and operations can introduce further rounding. Decimal and binary systems represent different sets of fractions exactly.


A truncation error arises when an infinite or limiting mathematical procedure is replaced by a finite approximation. Keeping finitely many terms of a Taylor expansion is one example. This error remains even if the retained terms are evaluated with exact arithmetic.


Source

What introduces it?

What can reduce it?

Input error

An inaccurate measurement or supplied value

Better input information

Round-off error

Finite representation and rounded operations

More precision or a more stable calculation

Truncation error

Replacing a limiting process with a finite approximation

A more accurate approximation


Reducing one source can increase another. The figure uses hypothetical dimensionless error scales 0.01h20.01h^2 and 10−6/h10^{-6}/h, where hh is a computational step. Their sum illustrates a tradeoff; it is not a universal formula for actual numerical error.


Three curves show competing truncation and round-off error scales and their sum against step size.



Propagating bounded input errors

Suppose y=f(x1,…,xn)y=f(x_1,\ldots,x_n) and each input changes by a small amount δxi\delta x_i. A first-order expansion gives


δy≈∑i=1n∂f∂xiδxi.\delta y\approx\sum_{i=1}^{n}\frac{\partial f}{\partial x_i}\delta x_i.


If ∣δxi∣≤Bi|\delta x_i|\leq B_i, an approximate worst-case absolute error bound is


By≈∑i=1n∣∂f∂xi∣Bi.B_y\approx\sum_{i=1}^{n}\left|\frac{\partial f}{\partial x_i}\right|B_i.


Evaluate the derivatives at the nominal inputs. Absolute values prevent opposite signs from cancelling when you seek a worst case. For a nonzero product or quotient written as y=C∏ixiaiy=C\prod_i x_i^{a_i},


By∣y∣≈∑i∣ai∣Bi∣xi∣.\frac{B_y}{|y|}\approx\sum_i |a_i|\frac{B_i}{|x_i|}.


These are first-order estimates, not guaranteed exact bounds. They require sufficiently small input changes and a smooth function throughout the relevant region. Strong curvature or a denominator approaching zero can make neglected terms important.



Sensitivity and arithmetic choices

A problem's conditioning concerns the mathematical function. A method's stability concerns additional errors introduced while computing it. A sensitive problem can amplify small input errors even when the algorithm performs well.


Subtraction of nearly equal approximations can cause cancellation. The difference is small, so existing absolute errors can become large relative to that difference. The subtraction itself need not introduce a new rounding error for accuracy to be lost.


An algebraically equivalent expression can sometimes avoid the troublesome subtraction. Keep extra digits during intermediate work and round the reported answer at the end, while recognizing that additional digits cannot repair inaccurate inputs.


What to remember

  • Measure error against a clearly identified reference and consistent units.
  • Separate input, round-off, and truncation errors.
  • Use derivatives to estimate propagation of small bounded errors.
  • Check sensitivity, cancellation, and the limits of first-order estimates.

Example: Error bounds for a measured speed

A tracking system calculates average speed from v=d/tv=d/t. Its reported distance is d=12.40 md=12.40\ \text{m} with an absolute error bound of 0.03 m0.03\ \text{m}, and its reported time is t=2.50 st=2.50\ \text{s} with an absolute error bound of 0.02 s0.02\ \text{s}. Treat these as deterministic bounds, with every combination of allowed distance and time possible. Assume arithmetic round-off is negligible.


Here a nominal value is the output calculated from the reported central inputs. Compare a first-order error estimate with a bound obtained from the full input intervals.


a) Calculate the nominal speed.


Substitute the reported distance and time into the speed formula. Both quantities are already in consistent SI units:


v0=dt=12.40 m2.50 s=4.96 m/s.v_0=\frac{d}{t}=\frac{12.40\ \text{m}}{2.50\ \text{s}}=4.96\ \text{m/s}.


The nominal speed is 4.96 m/s. This calculation establishes the central value against which output errors will be measured.


b) Estimate the worst-case absolute speed error using first-order propagation. Retain extra digits to allow comparison in part c.


First calculate the sensitivity to distance:


∂v∂d=1t=12.50 s.\frac{\partial v}{\partial d}=\frac{1}{t} =\frac{1}{2.50\ \text{s}}.


The distance sensitivity is ________. Next calculate the magnitude of the sensitivity to time:


∣∂v∂t∣=dt2=12.40 m(2.50 s)2.\left|\frac{\partial v}{\partial t}\right| =\frac{d}{t^2} =\frac{12.40\ \text{m}}{(2.50\ \text{s})^2}.


The time sensitivity magnitude is ________. Its signed derivative is negative because increasing the time while holding distance fixed decreases speed.


Multiply each sensitivity magnitude by its corresponding input error bound:


Bv,d=(0.400 s−1)(0.03 m),B_{v,d}=(0.400\ \text{s}^{-1})(0.03\ \text{m}),


Bv,t=(1.984 m/s2)(0.02 s).B_{v,t}=(1.984\ \text{m/s}^2)(0.02\ \text{s}).


The distance contribution is ________, and the time contribution is ________. Add these magnitudes for the approximate worst case:


Bv≈0.0120+0.03968=0.05168 m/s.B_v\approx0.0120+0.03968=0.05168\ \text{m/s}.


The first-order absolute error estimate is 0.05168 m/s. The derivative signs do not justify subtracting the contributions: a larger distance and a shorter time both raise the calculated speed.


c) Find the exact range of possible speeds and determine whether the first-order estimate guarantees a bound.


The input intervals are


12.37 m≤d≤12.43 m,2.48 s≤t≤2.52 s.12.37\ \text{m}\leq d\leq12.43\ \text{m}, \qquad 2.48\ \text{s}\leq t\leq2.52\ \text{s}.


Throughout these positive intervals, speed increases with distance and decreases with time. Therefore, the smallest speed uses the smallest distance and largest time:


vmin⁡=12.37 m2.52 s=4.908730… m/s.v_{\min}=\frac{12.37\ \text{m}}{2.52\ \text{s}} =4.908730\ldots\ \text{m/s}.


The largest speed uses the largest distance and smallest time:


vmax⁡=12.43 m2.48 s=5.012096… m/s.v_{\max}=\frac{12.43\ \text{m}}{2.48\ \text{s}} =5.012096\ldots\ \text{m/s}.


Measure the two endpoint deviations from the nominal speed:


v0−vmin⁡=0.0512698… m/s,v_0-v_{\min}=0.0512698\ldots\ \text{m/s},


vmax⁡−v0=0.0520968… m/s.v_{\max}-v_0=0.0520968\ldots\ \text{m/s}.


The larger deviation gives the exact maximum absolute error, approximately 0.0520968 m/s. Rounding the interval endpoints outward to four decimal places gives 4.9087 m/s≤v≤5.0121 m/s4.9087\ \text{m/s}\leq v\leq5.0121\ \text{m/s}.


The first-order estimate, 0.05168 m/s0.05168\ \text{m/s}, is slightly smaller than the exact maximum deviation. A first-order estimate need not be a guaranteed bound; here the full interval calculation captures the nonlinear effect of the denominator.

A program approximates e0.3e^{0.3} using 1+0.3+(0.3)2/21+0.3+(0.3)^2/2. Treat the exponent as exact. A symbolic check evaluates this polynomial with exact arithmetic, but its result still differs from e0.3e^{0.3}. Which error source explains the remaining discrepancy?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A timing routine returns 0.03720 s0.03720\ \text{s} for a benchmark whose exact reference duration is 37.50 ms37.50\ \text{ms}. Calculate the absolute relative error as a percentage. Enter your answer in percent, to two decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A numerical model calculates the dimensionless quantity z=x2/yz=x^2/y. Its nominal inputs are x=3.20x=3.20 and y=1.60y=1.60, with bounded errors ∣δx∣≤0.02|\delta x|\leq0.02 and ∣δy∣≤0.01|\delta y|\leq0.01. The input errors may vary freely within these bounds.


Find the nominal value of zz and its first-order worst-case absolute error bound. Enter both dimensionless quantities to two decimal places; enter the bound as a positive number.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors