< Floating Point

Granularity

Floating point numbers, because they are comprised of only a certain number of bits, have a granularity. They therefore cannot express an infinite amount of fractional values. This means that there is a "Largest Possible Value", ε, that satisfies the following equation:

This value is called the machine epsilon of the floating point system.

Epsilon (ε)

When a real number is rounded to the nearest floating point number, the machine epsilon forms an upper bound on the relative error. This fact makes the machine epsilon extremely useful in determining the convergence tolerances of many iterative numerical algorithms.

Determining Epsilon

The machine epsilon[1] can be computed according to the formula:

So, for IEEE 754 single precision we have

and for IEEE 754 double precision we have

When is not known, but is known to be 2, the machine epsilon can be found by starting with a trial value of, say, 0.5 and successively dividing the value by 2 until is true.

Granularity Effects

An effect of this granularity is that some basic algebraic properties don't strictly hold. For instance, if we have three floating-point values, x, y, and z, we can show that:

Especially the when floating-point numbers are used in iterative calculations, round-off and granularity errors can result in large errors.

References

  1. Machine espilon in wikipedia
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.