1.10: Machine Epsilon
( \newcommand{\kernel}{\mathrm{null}\,}\)
Machine epsilon (ϵmach) is the distance between 1 and the next largest number. If 0≤δ<ϵmach/2, then 1+δ=1 in computer math. Also since
x+y=x(1+y/x)
if 0≤y/x<ϵmach/2, then x+y=x in computer math.
Find ϵmach
The number 1 in the IEEE format is written as
1=20×1.000…0,
with 230′ s following the binary point. The number just larger than 1 has a 1 in the 23 rd position after the decimal point. Therefore,
ϵmach =2−23≈1.192×10−7
What is the distance between 1 and the number just smaller than 1? Here, the number just smaller than one can be written as
2−1×1.111…1=2−1(1+(1−2−23))=1−2−24
Therefore, this distance is 2−24=ϵmach/2.
The spacing between numbers is uniform between powers of 2, with logarithmic spacing of the powers of 2 . That is, the spacing of numbers between 1 and 2 is 2−23, between 2 and 4 is 2−22, between 4 and 8 is 2−21, etc. This spacing changes for denormal numbers, where the spacing is uniform all the way down to zero.
Find the machine number just greater than 5
A rough estimate would be 5(1+ϵmach )=5+5ϵmach , but this is not exact. The exact answer can be found by writing
5=22(1+14)
so that the next largest number is
22(1+14+2−23)=5+2−21=5+4ϵmach