Absolute Error
Goals
Understand the definition and properties of absolute error, learn to estimate error in computed results using propagation rules for arithmetic operations, and develop criteria for choosing between absolute and relative error.
Prerequisites
- Chapter 1: Floating-Point Numbers — how computers represent numbers
- Chapter 5: Significant Digits — 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.
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
- Independent of the magnitude of the true value — 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 and is far more precise in practice
The signed error $\Delta x = \tilde{x} - x$ is sometimes called the true error. $\Delta x > 0$ indicates overestimation, $\Delta x < 0$ indicates underestimation.
2. Calculation Methods and Notation
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, using the difference between successive approximations $|\tilde{x}_{n+1} - \tilde{x}_n|$ as an error estimate
- Residual: when solving $f(x) = 0$, using $|f(\tilde{x})|$ as a proxy for the error
Measurement results are often written as $\tilde{x} \pm \varepsilon$, e.g., "length $= 3.14 \pm 0.01\;\text{m}$" indicates an absolute error of at most $0.01\;\text{m}$.
3. Comparison with Relative Error
| Property | Absolute Error | Relative Error |
|---|---|---|
| Definition | $|x - \tilde{x}|$ | $|x - \tilde{x}| / |x|$ |
| Units | Same as true value | Dimensionless (can be expressed as %) |
| Near $x = 0$ | Meaningful | Difficult to define |
| 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. Absolute error is useful near zero, while relative error is better for assessing accuracy of large values.
4. Error Propagation Rules
Let $\tilde{x} = x + \Delta x$, $\tilde{y} = y + \Delta y$. The propagation of absolute error through arithmetic operations is as follows.
Addition and Subtraction
$$|\Delta(x \pm y)| \le |\Delta x| + |\Delta y|$$In addition/subtraction, absolute errors propagate additively. In subtraction where $x \approx y$, the absolute error remains the same but the relative error increases dramatically (catastrophic cancellation).
Multiplication
$$|\Delta(xy)| \approx |y||\Delta x| + |x||\Delta y|$$Division
$$\left|\Delta\left(\frac{x}{y}\right)\right| \approx \frac{|y||\Delta x| + |x||\Delta y|}{y^2}$$General Functions
If $f(x)$ is differentiable, the first-order error propagation is
$$|\Delta f| \approx |f'(x)| \cdot |\Delta x|$$For a multivariate function $f(x_1, x_2, \ldots, x_n)$:
$$|\Delta f| \approx \sum_{i=1}^{n} \left|\frac{\partial f}{\partial x_i}\right| |\Delta x_i|$$5. Relationship with Significant Digits
An approximation $\tilde{x}$ has $n$ significant digits if the absolute error satisfies
$$|x - \tilde{x}| \le \frac{1}{2} \times 10^{m-n+1}$$where $m$ is the exponent of the leading digit of $\tilde{x}$. For example, if $\tilde{x} = 3.1416$ has 4 significant digits, then $|x - \tilde{x}| \le 0.00005$.
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.00127\ldots$ |
| $355/113 \approx 3.14159292$ | $2.67 \times 10^{-7}$ |
Example 2: Error Propagation Calculation
Given $x = 2.0 \pm 0.1$, $y = 3.0 \pm 0.2$, find the errors of $f = x + y$ and $g = xy$.
Addition: $|\Delta f| \le |\Delta x| + |\Delta y| = 0.1 + 0.2 = 0.3$, so $f = 5.0 \pm 0.3$.
Multiplication: $|\Delta g| \approx |y||\Delta x| + |x||\Delta y| = 3.0 \times 0.1 + 2.0 \times 0.2 = 0.7$, so $g = 6.0 \pm 0.7$.
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 true value. For comparing values at different scales, relative error is more appropriate.
Q3. What are the error propagation rules?
In addition/subtraction, absolute errors add: $|\Delta(x \pm y)| \le |\Delta x| + |\Delta y|$. In multiplication/division, relative errors add. For a general function, the first-order approximation gives $|\Delta f| \approx |f'(x)| \cdot |\Delta x|$.
8. References
- Wikipedia "Approximation error"
- Wikipedia "Propagation of uncertainty"
- R. L. Burden & J. D. Faires, Numerical Analysis, 10th ed., Cengage, 2016.
- J. R. Taylor, An Introduction to Error Analysis, 2nd ed., University Science Books, 1997.