Numerical Analysis Home

Computational Errors


When we approximate a number \(x^*\) by a number \(x\), there are a few ways to measure errors:

  1. Absolute Error: \(|x^*-x|\)
  2. Relative Error: \(\displaystyle\frac{|x^*-x|}{|x|}, \; x\neq 0\)

For example, if we approximate \(x^*=1.24\) by \(x=1.25\), then the absolute error is \(|x^*-x|=|1.24-1.25|=0.01\) and the relative error is \(\displaystyle\frac{|x^*-x|}{|x|}= \displaystyle\frac{|1.24-1.25|}{|1.25|}=0.008\).

The relative error gives us information about the number of decimal digits of \(x^*\) and \(x\) match. We approximate \(x^*\) by \(x\) to \(n\) significant digits if \(n\) is the largest nonnegative integer for which \[\displaystyle\frac{|x^*-x|}{|x|}<5\cdot 10^{-n}.\]

Since \(\displaystyle\frac{|x^*-x|}{|x|}=0.008<5\cdot 10^{-2}\) and \(\displaystyle\frac{|x^*-x|}{|x|}=0.008\nless 5\cdot 10^{-3}\), we have the largest nonnegative integer \(n=2\). Thus \(x^*=1.24\) and \(x=1.25\) agree to \(2\) significant digits.

Last edited