Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I learnt that if the relative error is 5*$10^{-s}$ then the number of correct digits the result has $s$. Why is this so? Can you illustrate with an example and/or a proof?

Another way to put it appears to be that $n$ correct digits means a relative error with order of $10^{-n}$. Is it a definition?

share|improve this question
    
For example, 3.142 is said to have three correct decimals when the true value is 3.1416. –  909 Niklas Aug 10 '12 at 6:43

1 Answer 1

up vote 2 down vote accepted

Let y be a real number whose expansion is given by $$ y = \pm(0.d_{1}d_{2}d_{3}...d_{k}d_{k+1}...)_{\beta}\times\beta^{e} $$ with $ d_{1}\neq 0 $ and $ m\le e\le M $ where $\beta$ = the base, $k$ = the number of digits in the base $\beta$ expansion, $m$ = the minimum exponent and $M$ = the maximum exponent, and let $ fl(y) $ be the floating point equivalent of y. When the number chopped, the floating point equivalent is given by $$ fl_{chop}(y) = \pm(0.d_{1}d_{2}d_{3}...d_{k})_{\beta}\times\beta^{e} $$ when the number is rounded, $$ fl_{round}(y)=\pm(0.d_{1}d_{2}d_{3}...d_{k})_{\beta}\times\beta^{e}\qquad for \qquad d_{k+1}<\frac{\beta}{2} $$ $$ fl_{round}(y)=\pm[(0.d_{1}d_{2}d_{3}...d_{k})_{\beta}+\beta^{-k}]\times\beta^{e}\qquad for \qquad d_{k+1} \ge \frac{\beta}{2}$$ We have $$ |fl_{chop}(y)-y|=(0.d_{k+1}d_{k+2}d_{k+3}...)_{\beta}\times\beta^{e-k}\le(1.0)_{\beta}\times\beta^{e-k}=\beta^{e-k} $$ also $$ |y|=(0.d_{1}d_{2}d_{3}...)_{\beta}\times\beta^{e}\ge(0.1)_{\beta}\times\beta^{e}=\beta^{e-1} $$ therefore $$ \frac{|fl_{chop}(y)-y|}{|y|}\leq \frac{\beta^{e-k}}{\beta^{e-1}}=\beta^{1-k} $$ By proceeding in a similar manner, it can be shown that when a number is rounded, the bounds on both the absolute and relative error due to roundoff are one-half the bounds obtained when a number is chopped. That is $$ |fl_{round}(y)-y|\le \frac{1}{2} \beta^{e-k} $$ and $$ \frac{|fl_{round}(y)-y|}{|y|}\le \frac{1}{2} \beta^{1-k} $$ Now we are ready to the following definition,

Definition. Suppose that $x\neq 0$ and that $$ \beta^{-(t+1)}<\frac{|x-y|}{|x|}\le \beta^{-t} $$ for some positive integer $t$. Then we say that $x$ and $y$ agree to at least $t$ and at most $t+1$ SIGNIFICANT base $\beta$ DIGITS.

Source: A Friendly Introduction to Numerical Analysis by Brian Bradie.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.