*** Welcome to piglix ***

Loss of significance


Loss of significance is an undesirable effect in calculations using finite-precision arithmetic. It occurs when an operation on two numbers increases relative error substantially more than it increases absolute error, for example in subtracting two nearly equal numbers (known as catastrophic cancellation). The effect is that the number of significant digits in the result is reduced unacceptably. Ways to avoid this effect are studied in numerical analysis.

The effect can 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 decimal number

A floating-point representation of this number on a machine that keeps 10 floating-point digits would be

which is fairly close when measuring the error as a percentage of the value. It is very different when measured in order of precision. The first is accurate to 10×10−20, while the second is only accurate to 10×10−10.

Now perform the calculation

The answer, accurate to 10 significant digits, is

However, on the 10-digit floating-point machine, the calculation yields

In both cases the result is accurate to same order of magnitude as the inputs (-20 and -10, respectively). In the second case, the answer seems to have one significant digit, which would amount to loss of significance. However, in computer floating point arithmetic, all operations can be viewed as being performed on antilogarithms, for which the rules for significant figures indicate that the number of sigfigs remains the same as the smallest number of sigfigs in the mantissas. The way to indicate this and represent the answer to 10 sigfigs is:

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 floating-point arithmetic. Furthermore, it usually only postpones the problem: What if the data is accurate to only ten 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 well-posed, there should be a stable algorithm for solving it.


...
Wikipedia

...