Welcome to our community

Be a part of something great, join today!

Question about errors in Numerical Analysis

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,720
Hey!!! I am looking at an exercise in Numerical Analysis and I got stuck.
Why do we have a huge error when we substact two almost equal numbers?
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
8,780
Hey!!! I am looking at an exercise in Numerical Analysis and I got stuck.
Why do we have a huge error when we substact two almost equal numbers?
Hey evinda!

Suppose we calculate $1.000001 - 1$.
In a "float" you can only keep 7 significant digits, so the first number cannot have more reliable digits than it already has.
The accuracy of both numbers is $\pm 0.0000005$.
Or as a percentage: \(\displaystyle \frac{0.0000005}{1} \times 100\% = 0.00005 \%\), which is a pretty small error.


The result of the subtraction is $0.000001$, but its accuracy is still about $0.0000005$.
Or as a percentage \(\displaystyle \frac{0.0000005}{0.000001} \times 100\% = 50 \%\)


I'd say that is quite a large error relatively speaking. Don't you?
 

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,720
Great...I got it...Thank you very much!!! :eek: