1.10: Machine Epsilon
- Page ID
- 96036
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\ket}[1]{\left| #1 \right>}\)
\(\newcommand{\bra}[1]{\left< #1 \right|}\)
\(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
\(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
\(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
\(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
\(\newcommand{\expect}[1]{\langle #1 \rangle}\)
\(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)
Machine epsilon \(\left(\epsilon_{\mathrm{mach}}\right)\) is the distance between 1 and the next largest number. If \(0 \leq \delta<\epsilon_{\mathrm{mach}} / 2\), then \(1+\delta=1\) in computer math. Also since
\[x+y=x(1+y / x) \nonumber \]
if \(0 \leq y / x<\epsilon_{\operatorname{mach}} / 2\), then \(x+y=x\) in computer math.
Find \(\epsilon_{\text {mach }}\)
The number 1 in the IEEE format is written as
\[1=2^{0} \times 1.000 \ldots 0, \nonumber \]
with \(230^{\prime}\) s following the binary point. The number just larger than 1 has a 1 in the 23 rd position after the decimal point. Therefore,
\[\epsilon_{\text {mach }}=2^{-23} \approx 1.192 \times 10^{-7} \nonumber \]
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} \times 1.111 \ldots 1=2^{-1}\left(1+\left(1-2^{-23}\right)\right)=1-2^{-24} \nonumber \]
Therefore, this distance is \(2^{-24}=\epsilon_{\operatorname{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\left(1+\epsilon_{\text {mach }}\right)=5+5 \epsilon_{\text {mach }}\), but this is not exact. The exact answer can be found by writing
\[5=2^{2}\left(1+\frac{1}{4}\right) \nonumber \]
so that the next largest number is
\[2^{2}\left(1+\frac{1}{4}+2^{-23}\right)=5+2^{-21}=5+4 \epsilon_{\text {mach }} \nonumber \]


