Machine epsilon is the smallest floating-point value eps such that 1+eps > 1 in the machine's arithmetic. Starting from eps=2^-49 and halving repeatedly, the test 1+eps=1.0 first becomes true at eps=2^-53, confirming machine epsilon is 2^-52 (approximately 2.220e-16) for IEEE 754 double.

Example

Halve epsilon until adding it to 1 no longer changes the floating-point value.

highlighted = computed this step

Step 1 — Set up

Start halving epsilon from 2 to the -49.

ϵstart=249\epsilon_{\text{start}}= 2^{-49}

Step 2 — Halving 1

Add halving row 1 to the table.

nepsmantissaten exptest12508.88216NO\begin{array}{ccccc}\text{n} & \text{eps} & \text{mantissa} & \text{ten exp} & \text{test} \\ \hlmath{1} & \hlmath{2^{-50}} & \hlmath{8.882} & \hlmath{-16} & \hlmath{\text{NO}}\end{array}

Step 3 — Halving 2

Add halving row 2 to the table.

nepsmantissaten exptest12508.88216NO22514.44116NO\begin{array}{ccccc}\text{n} & \text{eps} & \text{mantissa} & \text{ten exp} & \text{test} \\ 1 & 2^{-50} & 8.882 & -16 & \text{NO} \\ \hlmath{2} & \hlmath{2^{-51}} & \hlmath{4.441} & \hlmath{-16} & \hlmath{\text{NO}}\end{array}

Step 4 — Halving 3

Add halving row 3 to the table.

nepsmantissaten exptest12508.88216NO22514.44116NO32522.22016NO\begin{array}{ccccc}\text{n} & \text{eps} & \text{mantissa} & \text{ten exp} & \text{test} \\ 1 & 2^{-50} & 8.882 & -16 & \text{NO} \\ 2 & 2^{-51} & 4.441 & -16 & \text{NO} \\ \hlmath{3} & \hlmath{2^{-52}} & \hlmath{2.220} & \hlmath{-16} & \hlmath{\text{NO}}\end{array}

Step 5 — Halving 4

Add halving row 4 to the table.

nepsmantissaten exptest12508.88216NO22514.44116NO32522.22016NO42531.11016YES\begin{array}{ccccc}\text{n} & \text{eps} & \text{mantissa} & \text{ten exp} & \text{test} \\ 1 & 2^{-50} & 8.882 & -16 & \text{NO} \\ 2 & 2^{-51} & 4.441 & -16 & \text{NO} \\ 3 & 2^{-52} & 2.220 & -16 & \text{NO} \\ \hlmath{4} & \hlmath{2^{-53}} & \hlmath{1.110} & \hlmath{-16} & \hlmath{\text{YES}}\end{array}

Step 6 — Machine epsilon

The last working epsilon is 2 to the -52.

ϵmach=2.220×1016=252\epsilon_{\text{mach}}= \hlmath{2.220\times 10^{-16}} = \hlmath{2^{-52}}
machine-epsilon-halving IEEE 754 double precision stores 52 mantissa bits. The smallest difference between 1.0 and the next representable number is 2^-52 ≈ 2.22e-16 (machine epsilon). Halve eps until 1+eps rounds to 1 in floating-point; the last eps where 1+eps > 1 equals machine epsilon.