<s>
Machine	B-Algorithm
epsilon	I-Algorithm
or	O
machine	B-Algorithm
precision	I-Algorithm
is	O
an	O
upper	O
bound	O
on	O
the	O
relative	B-Algorithm
approximation	I-Algorithm
error	I-Algorithm
due	O
to	O
rounding	B-Algorithm
in	O
floating	B-Algorithm
point	I-Algorithm
arithmetic	I-Algorithm
.	O
</s>
<s>
This	O
value	O
characterizes	O
computer	O
arithmetic	O
in	O
the	O
field	O
of	O
numerical	B-General_Concept
analysis	I-General_Concept
,	O
and	O
by	O
extension	O
in	O
the	O
subject	O
of	O
computational	O
science	O
.	O
</s>
<s>
The	O
quantity	O
is	O
also	O
called	O
macheps	B-Algorithm
and	O
it	O
has	O
the	O
symbols	O
Greek	O
epsilon	B-Language
.	O
</s>
<s>
In	O
numerical	B-General_Concept
analysis	I-General_Concept
,	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
dependent	O
on	O
the	O
type	O
of	O
rounding	B-Algorithm
used	O
and	O
is	O
also	O
called	O
unit	O
roundoff	O
,	O
which	O
has	O
the	O
symbol	O
bold	O
Roman	O
u	O
.	O
</s>
<s>
However	O
,	O
by	O
a	O
less	O
formal	O
,	O
but	O
more	O
widely-used	O
definition	O
,	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
independent	O
of	O
rounding	B-Algorithm
method	O
and	O
may	O
be	O
equivalent	O
to	O
u	O
or	O
2u	O
.	O
</s>
<s>
The	O
following	O
table	O
lists	O
machine	B-Algorithm
epsilon	I-Algorithm
values	O
for	O
standard	O
floating-point	B-Algorithm
formats	I-Algorithm
.	O
</s>
<s>
Rounding	B-Algorithm
is	O
a	O
procedure	O
for	O
choosing	O
the	O
representation	O
of	O
a	O
real	O
number	O
in	O
a	O
floating	B-Algorithm
point	I-Algorithm
number	I-Algorithm
system	O
.	O
</s>
<s>
For	O
a	O
number	O
system	O
and	O
a	O
rounding	B-Algorithm
procedure	O
,	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
the	O
maximum	O
relative	B-Algorithm
error	I-Algorithm
of	O
the	O
chosen	O
rounding	B-Algorithm
procedure	O
.	O
</s>
<s>
A	O
floating	B-Algorithm
point	I-Algorithm
number	I-Algorithm
system	O
is	O
characterized	O
by	O
a	O
radix	O
which	O
is	O
also	O
called	O
the	O
base	O
,	O
,	O
and	O
by	O
the	O
precision	B-General_Concept
,	O
i.e.	O
</s>
<s>
the	O
number	O
of	O
radix	O
digits	O
of	O
the	O
significand	B-Algorithm
(	O
including	O
any	O
leading	O
implicit	O
bit	O
)	O
.	O
</s>
<s>
Since	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
a	O
bound	O
for	O
relative	B-Algorithm
error	I-Algorithm
,	O
it	O
suffices	O
to	O
consider	O
numbers	O
with	O
exponent	O
.	O
</s>
<s>
For	O
the	O
usual	O
round-to-nearest	O
kind	O
of	O
rounding	B-Algorithm
,	O
the	O
absolute	O
rounding	B-Algorithm
error	O
is	O
at	O
most	O
half	O
the	O
spacing	O
,	O
or	O
.	O
</s>
<s>
This	O
value	O
is	O
the	O
biggest	O
possible	O
numerator	O
for	O
the	O
relative	B-Algorithm
error	I-Algorithm
.	O
</s>
<s>
The	O
denominator	O
in	O
the	O
relative	B-Algorithm
error	I-Algorithm
is	O
the	O
number	O
being	O
rounded	O
,	O
which	O
should	O
be	O
as	O
small	O
as	O
possible	O
to	O
make	O
the	O
relative	B-Algorithm
error	I-Algorithm
large	O
.	O
</s>
<s>
The	O
worst	O
relative	B-Algorithm
error	I-Algorithm
therefore	O
happens	O
when	O
rounding	B-Algorithm
is	O
applied	O
to	O
numbers	O
of	O
the	O
form	O
where	O
is	O
between	O
and	O
.	O
</s>
<s>
All	O
these	O
numbers	O
round	O
to	O
with	O
relative	B-Algorithm
error	I-Algorithm
.	O
</s>
<s>
The	O
in	O
the	O
denominator	O
is	O
negligible	O
compared	O
to	O
the	O
numerator	O
,	O
so	O
it	O
is	O
left	O
off	O
for	O
expediency	O
,	O
and	O
just	O
is	O
taken	O
as	O
machine	B-Algorithm
epsilon	I-Algorithm
.	O
</s>
<s>
As	O
has	O
been	O
shown	O
here	O
,	O
the	O
relative	B-Algorithm
error	I-Algorithm
is	O
worst	O
for	O
numbers	O
that	O
round	O
to	O
,	O
so	O
machine	B-Algorithm
epsilon	I-Algorithm
also	O
is	O
called	O
unit	O
roundoff	O
meaning	O
roughly	O
"	O
the	O
maximum	O
error	O
that	O
can	O
occur	O
when	O
rounding	B-Algorithm
to	O
the	O
unit	O
value	O
"	O
.	O
</s>
<s>
Thus	O
,	O
the	O
maximum	O
spacing	O
between	O
a	O
normalised	O
floating	B-Algorithm
point	I-Algorithm
number	I-Algorithm
,	O
,	O
and	O
an	O
adjacent	O
normalised	O
number	O
is	O
.	O
</s>
<s>
Numerical	B-General_Concept
analysis	I-General_Concept
uses	O
machine	B-Algorithm
epsilon	I-Algorithm
to	O
study	O
the	O
effects	O
of	O
rounding	B-Algorithm
error	O
.	O
</s>
<s>
The	O
IEEE	O
arithmetic	O
standard	O
says	O
all	O
floating-point	B-Algorithm
operations	O
are	O
done	O
as	O
if	O
it	O
were	O
possible	O
to	O
perform	O
the	O
infinite-precision	O
operation	O
,	O
and	O
then	O
,	O
the	O
result	O
is	O
rounded	O
to	O
a	O
floating-point	B-Algorithm
number	I-Algorithm
.	O
</s>
<s>
Suppose	O
(	O
1	O
)	O
,	O
are	O
floating-point	B-Algorithm
numbers	I-Algorithm
,	O
(	O
2	O
)	O
is	O
an	O
arithmetic	O
operation	O
on	O
floating-point	B-Algorithm
numbers	I-Algorithm
such	O
as	O
addition	O
or	O
multiplication	O
,	O
and	O
(	O
3	O
)	O
is	O
the	O
infinite	B-Algorithm
precision	I-Algorithm
operation	O
.	O
</s>
<s>
By	O
the	O
meaning	O
of	O
machine	B-Algorithm
epsilon	I-Algorithm
,	O
the	O
relative	B-Algorithm
error	I-Algorithm
of	O
the	O
rounding	B-Algorithm
is	O
at	O
most	O
machine	B-Algorithm
epsilon	I-Algorithm
in	O
magnitude	O
,	O
so	O
:	O
</s>
<s>
The	O
IEEE	O
standard	O
does	O
not	O
define	O
the	O
terms	O
machine	B-Algorithm
epsilon	I-Algorithm
and	O
unit	O
roundoff	O
,	O
so	O
differing	O
definitions	O
of	O
these	O
terms	O
are	O
in	O
use	O
,	O
which	O
can	O
cause	O
some	O
confusion	O
.	O
</s>
<s>
The	O
formal	O
definition	O
for	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
the	O
one	O
used	O
by	O
Prof	O
.	O
James	O
Demmel	O
in	O
lecture	O
scripts	O
,	O
the	O
LAPACK	B-Application
linear	B-Application
algebra	I-Application
package	I-Application
,	O
numerics	B-Algorithm
research	O
papers	O
and	O
some	O
scientific	O
computing	O
software	O
.	O
</s>
<s>
Most	O
numerical	B-General_Concept
analysts	I-General_Concept
use	O
the	O
words	O
machine	B-Algorithm
epsilon	I-Algorithm
and	O
unit	O
roundoff	O
interchangeably	O
with	O
this	O
meaning	O
.	O
</s>
<s>
This	O
alternative	O
definition	O
is	O
much	O
more	O
widespread	O
outside	O
academia	O
:	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
the	O
difference	O
between	O
1	O
and	O
the	O
next	O
larger	O
floating	B-Algorithm
point	I-Algorithm
number	I-Algorithm
.	O
</s>
<s>
By	O
this	O
definition	O
,	O
equals	O
the	O
value	O
of	O
the	O
unit	B-Algorithm
in	I-Algorithm
the	I-Algorithm
last	I-Algorithm
place	I-Algorithm
relative	O
to	O
1	O
,	O
i.e.	O
</s>
<s>
(	O
where	O
is	O
the	O
base	O
of	O
the	O
floating	B-Algorithm
point	I-Algorithm
system	O
and	O
is	O
the	O
precision	B-General_Concept
)	O
and	O
the	O
unit	O
roundoff	O
is	O
u	O
,	O
assuming	O
round-to-nearest	O
mode	O
,	O
and	O
u	O
,	O
assuming	O
round-by-chop	O
.	O
</s>
<s>
The	O
prevalence	O
of	O
this	O
definition	O
is	O
rooted	O
in	O
its	O
use	O
in	O
the	O
ISO	O
C	B-Language
Standard	O
for	O
constants	O
relating	O
to	O
floating-point	B-Algorithm
types	O
and	O
corresponding	O
constants	O
in	O
other	O
programming	O
languages	O
.	O
</s>
<s>
It	O
is	O
also	O
widely	O
used	O
in	O
scientific	O
computing	O
software	O
,	O
and	O
in	O
the	O
numerics	B-Algorithm
and	O
computing	O
literature	O
.	O
</s>
<s>
Where	O
standard	O
libraries	O
do	O
not	O
provide	O
precomputed	O
values	O
(	O
as	O
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1::epsilon( 	O
)	O
in	O
C++	B-Language
)	O
,	O
the	O
best	O
way	O
to	O
determine	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
to	O
refer	O
to	O
the	O
table	O
,	O
above	O
,	O
and	O
use	O
the	O
appropriate	O
power	O
formula	O
.	O
</s>
<s>
Computing	O
machine	B-Algorithm
epsilon	I-Algorithm
is	O
often	O
given	O
as	O
a	O
textbook	O
exercise	O
.	O
</s>
<s>
The	O
following	O
examples	O
compute	O
machine	B-Algorithm
epsilon	I-Algorithm
in	O
the	O
sense	O
of	O
the	O
spacing	O
of	O
the	O
floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
at	O
1	O
rather	O
than	O
in	O
the	O
sense	O
of	O
the	O
unit	O
roundoff	O
.	O
</s>
<s>
Note	O
that	O
results	O
depend	O
on	O
the	O
particular	O
floating-point	B-Algorithm
format	I-Algorithm
used	O
,	O
such	O
as	O
float	B-Algorithm
,	O
double	O
,	O
long	B-Language
double	I-Language
,	O
or	O
similar	O
as	O
supported	O
by	O
the	O
programming	O
language	O
,	O
the	O
compiler	O
,	O
and	O
the	O
runtime	O
library	O
for	O
the	O
actual	O
platform	O
.	O
</s>
<s>
Other	O
formats	O
might	O
be	O
emulated	O
by	O
the	O
runtime	O
library	O
,	O
including	O
arbitrary-precision	B-Algorithm
arithmetic	I-Algorithm
available	O
in	O
some	O
languages	O
and	O
libraries	O
.	O
</s>
<s>
In	O
a	O
strict	O
sense	O
the	O
term	O
machine	B-Algorithm
epsilon	I-Algorithm
means	O
the	O
accuracy	O
directly	O
supported	O
by	O
the	O
processor	O
(	O
or	O
coprocessor	O
)	O
,	O
not	O
some	O
accuracy	O
supported	O
by	O
a	O
specific	O
compiler	O
for	O
a	O
specific	O
operating	O
system	O
,	O
unless	O
it	O
's	O
known	O
to	O
use	O
the	O
best	O
format	O
.	O
</s>
<s>
IEEE	O
754	O
floating-point	B-Algorithm
formats	I-Algorithm
have	O
the	O
property	O
that	O
,	O
when	O
reinterpreted	O
as	O
a	O
two	O
's	O
complement	O
integer	O
of	O
the	O
same	O
width	O
,	O
they	O
monotonically	O
increase	O
over	O
positive	O
values	O
and	O
monotonically	O
decrease	O
over	O
negative	O
values	O
(	O
see	O
the	O
binary	O
representation	O
of	O
32	O
bit	O
floats	B-Algorithm
)	O
.	O
</s>
<s>
In	O
languages	O
that	O
allow	O
type	B-Language
punning	I-Language
and	O
always	O
use	O
IEEE	O
754-1985	O
,	O
we	O
can	O
exploit	O
this	O
to	O
compute	O
a	O
machine	B-Algorithm
epsilon	I-Algorithm
in	O
constant	O
time	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
C	B-Language
:	O
</s>
<s>
Example	O
in	O
Python	B-Language
:	O
</s>
<s>
The	O
following	O
simple	O
algorithm	O
can	O
be	O
used	O
to	O
approximate	O
the	O
machine	B-Algorithm
epsilon	I-Algorithm
,	O
to	O
within	O
a	O
factor	O
of	O
two	O
(	O
one	O
order	O
of	O
magnitude	O
)	O
of	O
its	O
true	O
value	O
,	O
using	O
a	O
linear	B-Algorithm
search	I-Algorithm
.	O
</s>
<s>
epsilon	B-Language
=	O
1.0	O
;	O
</s>
<s>
while	O
(	O
1.0	O
+	O
0.5	O
*	O
epsilon	B-Language
)	O
1.0	O
:	O
</s>
<s>
The	O
machine	B-Algorithm
epsilon	I-Algorithm
,	O
can	O
also	O
simply	O
be	O
calculated	O
as	O
two	O
to	O
the	O
negative	O
power	O
of	O
the	O
number	O
of	O
bits	O
used	O
for	O
the	O
mantissa	B-Algorithm
.	O
</s>
<s>
If	O
,	O
where	O
is	O
the	O
number	O
of	O
bits	O
used	O
for	O
the	O
magnitude	O
of	O
the	O
significand	B-Algorithm
,	O
then	O
:	O
</s>
