Approximation Erors
\(0\):
\(-0\):
\(\pm\infty\):
NaN:
Suppose \(x^*\) is an approximation of a real number \(x\).
\(\left\lvert x - x^*\right\rvert\) is the absolute approximation error.
\(\displaystyle \frac{\left\lvert x - x^*\right\rvert}{\left\lvert x\right\rvert}\) is the relative approximation error.
We say that \(x^*\) approximate \(x\) to \(s\) significant digits if \(s\) is the largest non-negative integer such that
\[\frac{\left\lvert x - x^*\right\rvert}{\left\lvert x\right\rvert} \le 5\times 10^{-s}\]
Given a real number \(x\), and a floating point system with \(k\) digit exponent and \(t\) digit mantissa:
We know that \(\left\lvert x\right\rvert = 1.\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\U{2423}\cdots \times 2^e \ge 2^e\)
\[\frac{\left\lvert x -\operatorname{fl}(x)\right\rvert}{\left\lvert x\right\rvert} \le \begin{cases} 2^{-t} & \text{ if chopping}\\ 2^{-t - 1} & \text{ if rounding}\end{cases}\]
Floating point numbers are not closed under arithmetic operations!
For example, if \(a\) and \(b\) are floating point numbers, \(a + b\) is not necessarily a floating point number!
What happens when we subtract two numbers that are very close to each other?
Using a rounding 6-digit decimal floats, subtract \(x = 1.123456\) and \(y = 1.123447\)