Content deleted Content added
Clarify the mainstream and formal definitions in the article lead. |
m Formatting fixes for previous edit. |
||
Line 8:
In the ''formal definition'', machine epsilon is dependent on the type of rounding used and is also called '''unit roundoff''', which has the symbol bold Roman '''u'''.
The two terms can generally be considered to differ by simply a factor of two, with the ''formal definition'' yielding an epsilon half the size of the ''mainstream definition'', as summarized in the tables in the next section
==Values for standard hardware arithmetics==
Line 53:
Thus, the maximum spacing between a normalised floating point number, <math>x</math>, and an adjacent normalised number is <math>2 \varepsilon |x|</math>.<ref>{{cite web |url=http://www.cs.berkeley.edu/~demmel/cs267/lecture21/lecture21.html |title=Basic Issues in Floating Point Arithmetic and Error Analysis |date=21 October 1999 |publisher=University of California, Berkeley |access-date=11 June 2022 |quote=The distance between 1 and the next larger floating point number is 2*macheps.}}</ref>
====Arithmetic model====
Numerical analysis uses machine epsilon to study the effects of rounding error. The actual errors of machine arithmetic are far too complicated to be studied directly, so instead, the following simple model is used. The IEEE arithmetic standard says all floating-point operations are done as if it were possible to perform the infinite-precision operation, and then, the result is rounded to a floating-point number. Suppose (1) <math>x</math>, <math>y</math> are floating-point numbers, (2) <math>\bullet</math> is an arithmetic operation on floating-point numbers such as addition or multiplication, and (3) <math>\circ</math> is the infinite precision operation. According to the standard, the computer calculates:
Line 65:
where <math>z</math> in absolute magnitude is at most <math>\varepsilon</math> or '''u'''. The books by Demmel and Higham in the references can be consulted to see how this model is used to analyze the errors of, say, Gaussian elimination.
===Mainstream definition (''Interval'' machine epsilon)<span class="anchor" id="Mainstream definition"></span>===
This alternative definition is significantly more widespread: ''machine epsilon is the difference between 1 and the next larger floating point number''. This definition is used in language constants in [[Ada (programming language)|Ada]], [[C (programming language)|C]], [[C++]], [[Fortran]], [[MATLAB]], [[Mathematica]], [[GNU Octave|Octave]], [[Pascal_(programming_language)|Pascal]], [[Python (programming language)|Python]] and [[Rust (programming language)|Rust]] etc., and defined in textbooks like «[[Numerical Recipes]]» by Press ''et al''.
|