Quantifying Error

True error is measured by the direct difference of a value, $x$, from the true value, $\mu$.

$$ E_t=x-\mu $$

Relative true error is measured by the difference of a value, $x$, from the true value, $\mu$, proportional to the magnitude of the true value. Typically, only the magnitude of this quantity is relevant.

$$ \varepsilon_t=|\frac{x-\mu}\mu| $$

Relative approximation error quantifies the error of an iterative algorithm, and is particularly useful for realistic scenarios where the true value is not know. It measures the difference of a current iteration’s value with the previous value, relative to the current value.

$$ \varepsilon_a=|\frac{x_n-x_{n-1}}{x_n}| $$

Categorizing Error

Roundoff Error

Real numbers in computers are represented in effect by a mantissa, $m$, and exponent, $e$, where $m$ and $e$ are signed integers.

$$ x=m\cdot2^e $$

Because these signed integers are limited in the number of digits they contain based on the memory allocated for each, the numbers have limited levels of precision. For example, with 8-bits of allocated memory to each, the value for the mantissa and exponent may look like the following. See the ‣ for more details.

$$ m=01010011,~~~~e=01110101 $$

This gives rise to roundoff error. In practice, this error is particularly problematic when summing numbers of vastly different magnitudes, because the mantissa, $m$, cannot be increased by a small enough increment to accurately depict the addition.

$$ x_1>>x_2\Longrightarrow x_1+x_2\approx x_1 $$

$$ m_1\cdot2^{e_1}>>m_2\cdot2^{e_2}\Longrightarrow m_1\cdot2^{e_1}+m_2\cdot2^{e_2}\approx m_1\cdot2^{e_1} $$

Truncation Error

All functions may be represented by a Taylor series expansion.

$$ f(x)=\Sigma\frac 1{n!}f^{(n)}(a)(x-a)^n $$

However, when we do numerical analysis, we often neglect the higher order terms, introducing error ‘on the order of $h^2$’, where $h=|x-a|$. We express this with Big-O-Notation, writing that the error is $O(h^2)$.