# Question about machine epsilon

I am studying over my notes, and there is something I don't understand about $$e_m$$. We represent the floating point numbers as $$1.d_1d_2...d_t \times \beta^e$$. Now, my professor defines $$\epsilon_m$$ as the smallest $$x$$ such that $$fl(1+x) > 1$$. But then she writes

$$\epsilon_m = \beta^{1-t} \hspace{1cm} \text{ (for "chopping")}$$ and

$$e_m = \dfrac 12 \beta^{1-t} \hspace{1cm} \text{ (for rounding)}$$ However, I think these should be $$\beta^{-t}$$ and $$\dfrac 12 \beta^{-t}$$, respectively.

The number $$1$$, and the next number right after, are

$$1.00 \cdots 00 \times \beta^0$$ and $$1.00 \cdots 01 \times \beta^0$$ where the $$1$$ is in the $$t^{th}$$ decimal place. Therefore their difference is $$\beta^{-t}$$ so if $$x = \beta^{-t}$$, then $$1+x$$ is itself a floating point number, so $$fl(1+x) = 1+x>1$$.

Am I wrong, or are the notes wrong?

Thank you very much.

There is a huge discrepancy in your notes. Either you assume that you are using base 2, in which case there should be no beta introduced, but just the number 2 used. Or you don't assume that you are using base 2, but for example base 10, then the number before the decimal point can't be forced to be 1 (or you could only represent 1 ≤ x < 2, 10 ≤ x < 20, 100 ≤ x < 200 etc. which would be obviously nonsense).

In base two, following your notes, the smallest floating point number ≥ 1 is $$1 + 2^{-t}$$. When "cutting off" (rounding down), the smallest x such that fl(1 + x) = 1 is x = $$2^{-t}$$.

When "rounding" (round to nearest), with x < $$2^{-t-1}$$ 1 + x will be rounded down to 0. With $$2^{-t-1}$$ < x < $$1.5 \cdot 2^{-t-1}$$ 1+x will be rounded to $$1 + 2^{-t}$$. The tricky one is x = $$2^{-t-1}$$. With IEEE 754 rules, the rounding mode is "round to nearest even" which means that if a number is exactly halfway between two floating point numbers, it is rounded to the number where the lowest mantissa bit is even, in this case rounded to 1. So the "machine epsilon" as defined would be slightly larger than $$2^{-t-1}$$. Or undefined, because there is no smallest x.

Instead of "machine epsilon" you will find more often the term "ulp" (unit in lowest position), which is the value of the lowest mantissa bit of the number 1, or ulp(x) which is the value of the lowest mantissa bit of the number x. The huge advantage is that the definition doesn't depend on the rounding mode.

There is definitely an inconsistency in what you've written here. My guess is that $$t$$ doesn't mean what you think it means. You are using it here to describe the size of the significand field, that is, the number of digits after the radix point. (It's not a decimal point in general!)

My guess is that your lecturer is using it to refer to the precision. The precision of the floating point format includes the implicit $$1$$. That is, your floating point number is:

$$d_1.d_2 d_3 d_4 \ldots d_t \times \beta^e$$

where $$d_1$$ is always $$1$$. If you interpret $$t$$ that way, the two epsilons make more sense.

This is the way that the IEEE-754 standard defines these constants. For example, a binary32 (formerly called "single precision") floating point number has a precision of 24 bits, in that the mantissa is 24 bits. However, the significand field is only 23 bits, because the leading one bit is implicit.