The floating point function of Chopping. Absolute error and Relative error.

838 Views Asked by At

Consider a number $(x)_\beta$ : $$x = \pm 0.d_1d_2 \ldots d_pd_{p+1}d_{p+2} \ldots \times \beta^E$$ The function $chop(x)$ considers only the first $p$ digits ignoring digits from $(p+1)$th to infinite. So the machine number $\tilde{x}$ is the number obtained from the above function: $$\tilde{x} = chop(x) = \pm0.d_1d_2 \ldots d_p \times \beta^E$$

For the Absolute Error $e_A$ we have : \begin{split} e_A(chop(x)) & = |x - chop(x)| \\ & = 0.\underbrace{00 \ldots 0}_{p \text{ zeros} }d_{p+1}d_{p+2} \ldots \times \beta^E \\ & = 0.d_{p+1}d_{p+2}\ldots \times \beta^{E-p} < \beta^{E-p} \end{split}

For the Relative Error $e_R$ we have that:

\begin{split} |x| & \ge 0.d_1 \times \beta^{E} \\ & = d_1 \times \beta^{E-1} \ge \beta^{E-1} \end{split}

since $d_1 \ne 0$ we have that: $$ \begin{array}{lcl} e_R(chop(x)) & = & \left | \frac{x - chop(x)}{x} \right | & < & \frac{\beta^{E-p}}{\beta^{E-1}} & = & \beta^{1-p} \end{array} $$

We can see that the Relative Error, (conversely from the Absolute Error), doesn't depend from the size of the number, but only from he number of digits of the mantissa. Therefore, if we have many digits in the mantissa, the Relative Error will be smaller.


This is what I want to ask:

In the last part, I don't understand how to obtain that inequality:

$$\begin{align}{} \ldots = \left | \frac{x - chop(x)}{x} \right | < \frac{\beta^{E-p}}{\beta^{E-1}} = \ldots \end{align}$$

I know that:

  • $|x-chop(x)| < \beta^{E-p}$
  • $|x| \ge \beta^{E-1}$

it seems that we have an implication like this, (using a not fully suitable notation) : $$$$\begin{align}{} \frac{\left | x - chop(x) \right | < \beta^{E-p}}{|x| \ge \beta^{E-1}} \Longrightarrow \left | \frac{x - chop(x)}{x} \right | < \frac{\beta^{E-p}}{\beta^{E-1}} \end{align}$$$$

Is there any algebraic-property applied here?

Please, Can you give me any suggestions? Many thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

From $|x| \geq \beta^{E - 1}$ we have upper bound for $\frac{1}{|x|}$ (assuming everything is positive) $$ \frac{1}{|x|} \leq \frac{1}{\beta^{E - 1}} \quad (1) $$ we can now apply this and the $$|x - chop(x)| < \beta^{E-p}\quad (2)$$ to $$ \left | \frac{x - chop(x)}{x} \right | = |x - chop(x)|\cdot \frac{1}{|x|} $$ first we use (1) getting $$ |x - chop(x)|\cdot \frac{1}{|x|} \leq |x - chop(x)|\cdot \frac{1}{\beta^{E - 1}}$$ then we use (2) to get the upper bound you are asking about $$ |x - chop(x)|\cdot \frac{1}{|x|} < \beta^{E-p}\cdot \frac{1}{\beta^{E - 1}}. $$

Now the main question I guess is how do we get $$ |x| \geq \beta^{E - 1} \rightarrow \frac{1}{|x|} \leq \frac{1}{\beta^{E - 1}}.$$ The most general rule I think is that when you apply decreasing function to an inequality you have to flip the inequality sign. You are probably familiar with this for multiplication by $-1$ that is apply $f(x) = -1x$ to both sides of inequality. For $$ a \leq b $$ we have $$ -a \geq -b.$$ In this case you are applying $f(x) = \frac{1}{x}$ to both sides of the inequality which is decreasing function so we have $$ a < b \rightarrow \frac{1}{a} > \frac{1}{b}. $$ To demonstrate with numbers $$ 0.5 < 2 \rightarrow \frac{1}{.5} = 2 > \frac{1}{2}. $$ You can also easily see this if you plot the $f$ for positive numbers.