Content deleted Content added
m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:Q1780355 |
Clarify the mainstream and formal definitions in the article lead. |
||
Line 2:
'''Machine epsilon''' or '''machine precision''' is an upper bound on the [[relative approximation error]] due to [[rounding]] in [[floating point]] number systems. This value characterizes [[computer arithmetic]] in the field of [[numerical analysis]], and by extension in the subject of [[computational science]]. The quantity is also called '''macheps''' and it has the symbols Greek [[epsilon]] <math>\varepsilon</math>.
There are two prevailing definitions, denoted here as [[#Formal definition|''rounding machine epsilon'' or the ''formal definition'']] and [[#Mainstream definition|''interval machine epsilon''
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. This article then considers the formal definition in depth before continuing to a discussion of the mainstream definition.
==Values for standard hardware arithmetics==
Line 29 ⟶ 35:
{{notelist|group=table}}
==Alternative definitions for epsilon==
==Formal definition (''Rounding'' machine epsilon)<span class="anchor" id="Formal definition"></span>==▼
The IEEE standard does not define the terms ''machine epsilon'' and ''unit roundoff'', so differing definitions of these terms are in use, which can cause some confusion.▼
The two terms differ by simply a factor of two. The more-widely used term (referred to as the ''mainstream definition'' in this article), is used in most modern programming languages and is simply defined as ''machine epsilon is the difference between 1 and the next larger floating point number''. The ''formal definition'' can generally be considered to yield an epsilon half the size of the ''mainstream definition'', although its definition does vary depending on the form of rounding used.
The two terms are described at length in the next two subsections.
▲===Formal definition (''Rounding'' machine epsilon)<span class="anchor" id="Formal definition"></span>===
The [[#Formal definition|formal definition]] for ''machine epsilon'' is the one used by Prof. [[James Demmel]] in lecture scripts,<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 Oct 1999 |access-date=11 Apr 2013}}</ref> the ''LAPACK'' linear algebra package,<ref>{{cite web |url=http://www.netlib.org/lapack/lug/node74.html |title=LAPACK Users' Guide Third Edition |date=22 August 1999 |access-date=9 March 2012}}</ref> numerics research papers<ref>{{cite web |title=David Goldberg: What Every Computer Scientist Should Know About Floating-Point Arithmetic, ACM Computing Surveys, Vol 23, No 1, March 1991 |url=https://www.ualberta.ca/~kbeach/phys420_580_2010/docs/ACM-Goldberg.pdf |access-date=11 Apr 2013}}</ref> and some scientific computing software.<ref>{{cite web |url=http://help.scilab.org/docs/5.3.3/en_US/number_properties.html |title=Scilab documentation - number_properties - determine floating-point parameters |access-date=11 Apr 2013}}</ref> Most numerical analysts use the words ''machine epsilon'' and ''unit roundoff'' interchangeably with this meaning, which is explored in depth throughout this subsection.▼
''Rounding'' is a procedure for choosing the representation of a [[real number]] in a [[floating point]] number system. For a [[number system]] and a rounding procedure, machine epsilon is the maximum [[relative error]] of the chosen rounding procedure.
Line 52 ⟶ 66:
==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''.
▲The IEEE standard does not define the terms ''machine epsilon'' and ''unit roundoff'', so differing definitions of these terms are in use, which can cause some confusion.
▲The [[#Formal definition|formal definition]] for ''machine epsilon'' is the one used by Prof. [[James Demmel]] in lecture scripts,<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 Oct 1999 |access-date=11 Apr 2013}}</ref> the ''LAPACK'' linear algebra package,<ref>{{cite web |url=http://www.netlib.org/lapack/lug/node74.html |title=LAPACK Users' Guide Third Edition |date=22 August 1999 |access-date=9 March 2012}}</ref> numerics research papers<ref>{{cite web |title=David Goldberg: What Every Computer Scientist Should Know About Floating-Point Arithmetic, ACM Computing Surveys, Vol 23, No 1, March 1991 |url=https://www.ualberta.ca/~kbeach/phys420_580_2010/docs/ACM-Goldberg.pdf |access-date=11 Apr 2013}}</ref> and some scientific computing software.<ref>{{cite web |url=http://help.scilab.org/docs/5.3.3/en_US/number_properties.html |title=Scilab documentation - number_properties - determine floating-point parameters |access-date=11 Apr 2013}}</ref> Most numerical analysts use the words ''machine epsilon'' and ''unit roundoff'' interchangeably with this meaning.
▲This alternative definition is significantly more widespread: ''machine epsilon is the difference between 1 and the next larger floating point number''.
By this definition, ''ε'' equals the value of the [[unit in the last place]] relative to 1, i.e. <math>b^{-(p-1)}</math> (where {{mvar|b}} is the base of the floating point system and {{mvar|p}} is the precision) and the unit roundoff is '''u''' = ''ε'' / 2, assuming [[Round-off#Roundoff error under different rounding rules|round-to-nearest]] mode, and '''u''' = ''ε'', assuming [[Round-off#Roundoff error under different rounding rules|round-by-chop]].
|