Absolute Error
Goals
Understand the definition and properties of absolute error, learn to estimate the error of computed results — as a rigorous bound for addition and subtraction, and mainly as a first-order approximation for multiplication, division and general functions — and develop criteria for choosing between absolute and relative error.
Prerequisites
- Chapter 1: Floating-Point Numbers — how computers represent numbers
- Chapter 5: Significant Digits and Rounding Error — the concept of significant figures (used in §5)
- Basic calculus — derivatives $f'(x)$ are used in error propagation (§4)
Contents
1. Definition
Absolute error is the absolute value of the difference between the true value $x$ and the approximation $\tilde{x}$.
Absolute error measures how far a measured or computed value deviates from the true value, expressed in actual units. It is the most fundamental measure of error.
The main sources of absolute error are (1) measurement error, (2) roundoff error from representing numbers with finitely many digits (Chapter 8), and (3) truncation error from cutting off an infinite process (Chapter 9). This chapter measures all of them together by "how far off" the result is.
Properties of Absolute Error
- Always non-negative: $E_{\text{abs}} \ge 0$
- $E_{\text{abs}} = 0$ means the approximation is perfectly accurate
- Has the same units (dimensions) as the true value
- Not normalized by the magnitude of the true value — the same difference gives the same absolute error regardless of how large the true value is. For example, the approximation $1.01$ (true value $1$) and $1\,000\,000.01$ (true value $10^6$) both have an absolute error of $0.01$, yet the latter has a much smaller relative error, i.e., it is far closer in relative terms
In this article the signed error is defined as $\Delta x = \tilde{x} - x$. This quantity is sometimes called the true error, but note that the sign convention varies between references (some define it as true value $-$ approximation). With our convention, $\Delta x > 0$ indicates overestimation and $\Delta x < 0$ indicates underestimation.
2. Calculation Methods and the Case of an Unknown True Value
Computing absolute error involves simple subtraction and taking the absolute value.
$$E_{\text{abs}} = |x - \tilde{x}|$$In practice, the true value $x$ is often unknown. Alternative approaches include:
- Error bound: finding an upper bound $|x - \tilde{x}| \le \varepsilon$
- A posteriori estimation: in iterative methods, once convergence has been confirmed, using the difference between successive approximations $|\tilde{x}_{n+1} - \tilde{x}_n|$ as a rough indicator of the error. In general it is not the true error itself: if the convergence ratio $r$ is close to $1$ (slow convergence), the true error of $\tilde{x}_{n+1}$ can be about $r/(1-r)$ times this difference, a severe underestimate
- Residual: when solving $f(x) = 0$, using $|f(\tilde{x})|$ as an indicator of how good the approximation is. The residual is a deviation in the function value and does not even have the same units as the error in the solution $|\tilde{x} - x|$; relating the two requires, e.g., that $|f'(x)|$ is sufficiently large near the root. For ill-conditioned problems with small $|f'|$, a small residual does not imply a small error
Measurement results are often written as $\tilde{x} \pm \varepsilon$ to state the error bound: written as an error bound, "length $= 3.14 \pm 0.01\;\text{m}$" means that the absolute error is at most $0.01\;\text{m}$. This is the meaning of $\pm$ used in this article (in metrology, $\pm$ may instead denote a standard uncertainty or a confidence interval).
3. Comparison with Relative Error
| Property | Absolute Error | Relative Error |
|---|---|---|
| Definition | $|x - \tilde{x}|$ | $|x - \tilde{x}| / |x| \quad (x \neq 0)$ |
| Units | Same as true value | Dimensionless (can be expressed as %) |
| Near $x = 0$ | Meaningful | Undefined at $x = 0$ (unstable near $0$) |
| Scale invariance | No | Yes |
| Best suited for | Comparing values at the same scale | Comparing values at different scales |
Absolute error and relative error are complementary. Near zero the relative error is unstable or undefined, so one usually evaluates with the absolute error or a problem-specific tolerance (for a modified definition that covers $x = 0$, see Chapter 7, §5). When comparing values at different scales, use the relative error as well.
4. Error Propagation: Bounds and First-Order Approximation
Let $\tilde{x} = x + \Delta x$, $\tilde{y} = y + \Delta y$. We describe error propagation through arithmetic operations as a rigorous upper bound for addition and subtraction, and as a first-order approximation that neglects higher-order error terms for multiplication and division.
Addition and Subtraction
$$|\Delta(x \pm y)| \le |\Delta x| + |\Delta y|$$In addition/subtraction, the bounds on the absolute errors add. In subtraction where $x \approx y$, the bound on the absolute error is $|\Delta x| + |\Delta y|$ just as for addition, but because the result $x - y$ is small, the relative error tends to become large (catastrophic cancellation).
Multiplication
$$|\Delta(xy)| \le |y||\Delta x| + |x||\Delta y| + |\Delta x||\Delta y|$$Indeed, $\tilde{x}\tilde{y} - xy = y\,\Delta x + x\,\Delta y + \Delta x\,\Delta y$. When $|\Delta x|, |\Delta y|$ are sufficiently small, the second-order term $|\Delta x||\Delta y|$ is neglected and one estimates $|\Delta(xy)| \lesssim |y||\Delta x| + |x||\Delta y|$ (first-order approximation). The right-hand side, with absolute values on every term, is a worst-case upper bound; if the signs of $\Delta x$ and $\Delta y$ cancel, the actual error is much smaller.
Division
$$\left|\Delta\left(\dfrac{x}{y}\right)\right| \lesssim \dfrac{|y||\Delta x| + |x||\Delta y|}{|y|^2} \quad (y \neq 0)$$This is a first-order approximation valid when $y \neq 0$ and $|\Delta y|$ is sufficiently small compared with $|y|$ (so that $\tilde{y}$ does not cross $0$). When $|y|$ is small, the error is greatly amplified.
General Functions
If $f$ is differentiable near $x$ and $|\Delta x|$ is sufficiently small, the first-order estimate is
$$|\Delta f| \approx |f'(x)| \cdot |\Delta x|$$(the absolute value of both sides of $\Delta f \approx f'(x)\,\Delta x$; unlike the multiplication and division formulas, this approximates the size of the error itself). If a rigorous bound is needed, use the maximum $M$ of $|f'|$ in the neighborhood: $|\Delta f| \le M |\Delta x|$ (mean value theorem). For a multivariate function $f(x_1, x_2, \ldots, x_n)$:
$$|\Delta f| \lesssim \sum_{i=1}^{n} \left|\dfrac{\partial f}{\partial x_i}\right| |\Delta x_i|$$This is the first-order worst-case bound, in which every error is aligned in the least favorable direction. If the errors are independent random quantities, combine them in quadrature, $\sqrt{\sum_i (\partial f/\partial x_i)^2 \sigma_i^2}$ (this is what the reference "Propagation of uncertainty" treats).
5. Significant Digits and Absolute Error Bounds
An approximation $\tilde{x}$ has $n$ significant digits if the absolute error is at most half a unit in the $n$-th digit, i.e.,
$$|x - \tilde{x}| \le \dfrac{1}{2} \times 10^{m-n+1}$$and the number of significant digits is the largest non-negative integer $n$ satisfying this inequality. Here $m$ is the exponent of the leading digit of $\tilde{x}$, i.e., the integer with $10^m \le |\tilde{x}| < 10^{m+1}$. For example, $\tilde{x} = 3.1416$ has $m = 0$; if it has 5 significant digits, then $|x - \tilde{x}| \le 0.00005$ (with 4 digits the bound would be $0.0005$).
6. Worked Examples
Example 1: Approximations of Pi
Absolute errors for various approximations of $\pi = 3.14159265\ldots$:
| Approximation $\tilde{x}$ | Absolute error $|x - \tilde{x}|$ |
|---|---|
| $3$ | $0.14159\ldots$ |
| $3.14$ | $0.00159\ldots$ |
| $22/7 \approx 3.14286$ | $0.00126\ldots$ |
| $355/113 \approx 3.14159292$ | $2.67 \times 10^{-7}$ |
Example 2: Error Propagation Calculation
Given measured values $\tilde{x} = 2.0$, $\tilde{y} = 3.0$ with error bounds $|\Delta x| \le 0.1$, $|\Delta y| \le 0.2$ (i.e., $\tilde{x} = 2.0 \pm 0.1$, $\tilde{y} = 3.0 \pm 0.2$), find error bounds for $f = x + y$ and $g = xy$.
Addition: $|\Delta f| \le |\Delta x| + |\Delta y| = 0.1 + 0.2 = 0.3$, so $\tilde{f} = 5.0 \pm 0.3$. Indeed, $x \in [1.9, 2.1]$, $y \in [2.8, 3.2]$ give $x + y \in [4.7, 5.3]$, so this bound is exact.
Multiplication: since $\tilde{x}\tilde{y} - xy = \tilde{y}\,\Delta x + \tilde{x}\,\Delta y - \Delta x\,\Delta y$, we have $|\Delta g| \le |\tilde{y}||\Delta x| + |\tilde{x}||\Delta y| + |\Delta x||\Delta y| = 3.0 \times 0.1 + 2.0 \times 0.2 + 0.1 \times 0.2 = 0.72$, so $\tilde{g} = 6.0 \pm 0.72$. The first-order formula gives $0.7$, but it drops the second-order term $0.02$, and the interval $[5.3, 6.7]$ does not contain the largest attainable value $2.1 \times 3.2 = 6.72$. When stating a bound, keep the second-order term.
7. FAQ
Q1. What is absolute error?
It is the absolute value of the difference between the true value and the approximation, $|x - \tilde{x}|$. It measures how far the approximation deviates from the true value in actual units.
Q2. What is the difference between absolute and relative error?
Absolute error has the same units as the true value, while relative error is a dimensionless quantity obtained by dividing the absolute error by the absolute value of the true value. For comparing values at different scales, relative error is more appropriate.
Q3. What should I keep in mind when using error propagation?
For addition/subtraction the bound $|\Delta(x \pm y)| \le |\Delta x| + |\Delta y|$ holds rigorously. The multiplication/division formulas are first-order approximations that neglect the second-order error term; when used as bounds, keep that term (§4, §6). For multiplication/division, relative errors add, which is derived in Chapter 7, §3. For a general function, when the error is small enough, the first-order approximation $|\Delta f| \approx |f'(x)| \cdot |\Delta x|$ gives an estimate; a rigorous evaluation requires checking higher-order terms or a bound on the derivative.
8. References
- Wikipedia "Approximation error"
- Wikipedia "Propagation of uncertainty"
- R. L. Burden, J. D. Faires & A. M. Burden, Numerical Analysis, 10th ed., Cengage, 2016.
- J. R. Taylor, An Introduction to Error Analysis, 2nd ed., University Science Books, 1997.