The definition and meaning of "machine epsilon" in MATLAB

1.7k Views Asked by At

I am taking a introductory course in numerical mathematics, using MATLAB and a numerical math text that refers to MATLAB often. In the text, the machine precision is defined as:

The distance $\epsilon$ between 1 and the next largest floating point number that can be represented in the system.

In MATLAB, the command help('eps') agrees, stating:

eps, with no arguments, is the distance from 1.0 to the next larger double precision number.

Now, my understanding is that this should mean that $1+\epsilon$ is the smallest number greater than 1 that can be represented, so we should have: $$1+0.9\epsilon = 1$$ $$1+\epsilon \ne 1$$

However, in MATLAB, the number that I intuitively understand to have the properties of $\epsilon$ seems to actually be just above $\epsilon/2$. Observe that the code

    1+eps==1
    1+eps*0.9==1
    1+eps*0.51==1
    1+eps*0.5==1

Produces the output:

    ans = 0
    ans = 0
    ans = 0
    ans = 1

How am I misinterpreting the definition of eps? Is is because some of these numbers are not normalized?