Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Round-off error
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Subtraction === Absorption also applies to subtraction. * For example, subtracting <math>2^{-60}</math> from <math>1</math> in IEEE double precision as follows, <math display="block">\begin{align} 1.00\ldots 0 \times 2^{0} - 1.00\ldots 0 \times 2^{-60} &= \underbrace{1.00\ldots 0}_\text{60 bits} \times 2^{0} - \underbrace{0.00\ldots 01}_\text{60 bits} \times 2^{0}\\ &= \underbrace{0.11\ldots 1}_\text{60 bits}\times 2^{0}. \end{align}</math> This is saved as <math>\underbrace{1.00\ldots 0}_\text{53 bits}\times 2^{0}</math> since round-to-nearest is used in IEEE standard. Therefore, <math>1-2^{-60}</math> is equal to <math>1</math> in IEEE double precision and the roundoff error is <math>-2^{-60}</math>. The subtracting of two nearly equal numbers is called '''subtractive cancellation'''.<ref name="Forrester_2018"/> When the leading digits are cancelled, the result may be too small to be represented exactly and it will just be represented as <math>0</math>. * For example, let <math>|\epsilon| < \epsilon_\text{mach}</math> and the second definition of machine epsilon is used here. What is the solution to <math>(1+\epsilon) - (1-\epsilon)</math>?{{Break}} It is known that <math>1+\epsilon</math> and <math>1-\epsilon</math> are nearly equal numbers, and <math>(1+\epsilon) - (1-\epsilon)=1+\epsilon-1+\epsilon=2\epsilon</math>. However, in the floating-point number system, <math>fl((1+\epsilon) - (1-\epsilon))=fl(1+\epsilon)-fl(1-\epsilon)=1-1=0</math>. Although <math>2\epsilon</math> is easily big enough to be represented, both instances of <math>\epsilon</math> have been rounded away giving <math>0</math>. Even with a somewhat larger <math>\epsilon</math>, the result is still significantly unreliable in typical cases. There is not much faith in the accuracy of the value because the most uncertainty in any floating-point number is the digits on the far right. * For example, <math>1.99999 \times 10 ^{2}- 1.99998 \times 10^{2} = 0.00001\times10^{2} =1 \times 10^{-5}\times 10^{2}=1\times10^{-3}</math>. The result <math>1\times10^{-3}</math> is clearly representable, but there is not much faith in it. This is closely related to the phenomenon of [[catastrophic cancellation]], in which the two numbers are ''known'' to be approximations.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)