In the mathematical subfield of numerical analysis the approximation error in some data is the discrepancy between an exact value and some approximation to it. An approximation error can occur because
- the measurement of the data is not precise (due to the instruments), or
- we use approximations instead of the real data (e.g., 3.14 instead of π).
One commonly distinguishes between the relative error and the absolute error.
The numerical stability of an algorithm in numerical analysis indicates how the error is propagated by the algorithm.
Definition
Given some (true) value a and an approximation b of a, the absolute error is
- , (sometimes also used without taking the absolute value)
the relative error (with sign) is
- ,
and the absolute relative error is
- ,
where the vertical bars denote the absolute value.