Loss of significance is an undesirable effect in calculations using floatingpoint arithmetic. It occurs when an operation on two numbers increases relative error substantially more than it increases absolute error, for example in subtracting two large and nearly equal numbers. The effect is that the number of accurate (significant) digits in the result is reduced unacceptably. Ways to avoid this effect are studied in numerical analysis.
In floatingpoint arithmetic, only a limited number of digits of the number are maintained; floatingpoint numbers can only approximate most real numbers.
Example:
For the purposes of this example, if the reader is not familiar with binary numbers, bits can be considered as decimal digits.
Consider the real binary number
1.001111111
A floatingpoint representation of this number on a machine that keeps 4 floatingpoint bits would be
1.001,
which is fairly close — the difference is very small in comparison with either of the two numbers.
Now perform the calculation
1.001111111 − 1
The real answer, accurate to 7 significant bits, is
0.001111111
However, on the 4bit floatingpoint machine, the calculation yields
1.001 − 1.000 = 0.001
Whereas the original numbers are significant in all of the first 4 bits, their floatingpoint difference is only accurate in its first nonzero bit. This amounts to loss of information.
This phenomenon is relevant for any size Floating Point number.
Instead of 4 significant bits, an IEEE standard single precision floating point number has 23 significant bits and 1 sign bit.
Additionally, the phenomenon can also be demonstrated with decimal numbers.
The following example demonstrates Loss of Significance for a Decimal floating point data type with 10 significant digits:
Consider the real decimal number
0.1234567891234567890.
A floatingpoint representation of this number on a machine that keeps 10 floatingpoint digits would be
0.1234567891,
which is fairly close — the difference is very small in comparison with either of the two numbers.
Now perform the calculation
0.1234567891234567890 − 0.1234567890.
The real answer, accurate to 10 digits, is
0.0000000001234567890.
However, on the 10digit floatingpoint machine, the calculation yields
0.1234567891 − 0.1234567890 = 0.0000000001.
Whereas the original numbers are accurate in all of the first (most significant) 10 digits, their floatingpoint difference is only accurate in its first nonzero digit. This amounts to loss of information.
'Workarounds It is possible to do computations using an exact fractional representation of rational numbers and keep all significant digits, but this is often prohibitively slower than floatingpoint arithmetic. Furthermore, it usually only postpones the problem: What if the data is accurate to only 10 digits? The same effect will occur.
One of the most important parts of numerical analysis is to avoid or minimize loss of significance in calculations. If the underlying problem is wellposed, there should be a stable algorithm for solving it. The art is in finding a stable algorithm.
[edit] Loss of significant bits
Let x and y be positive normalized floating point numbers.
In the subtraction x − y, r significant bits are lost where
for some positive integers p and q.
Instability of the quadratic equation
For example, consider the venerable quadratic equation.
For the polynomial equation, ax^{2} + bx + c = 0,
Full article ▸
