3

For the IEEE floating point number, why do these equal epsilon m?

(1 - 1e-16) - 1 ans = -1.1102e-16

1 + (1e-16 - 1) ans = 1.1102e-16

While, on the other hand, below equals 0

(1 + 1e-16) - 1 ans = 0

Can someone explain to me why? For the last one, I understand that fl(x) = 1 for 1 ≤ x ≤ 1 + M and fl(x) = 1 + 2M for 1 + M < x ≤ 1 + 2M

Shouldn't the first two equal 0 since fl(x) = 1 for 1 - M < x ≤ 1 and fl(x) = 1 - 2M for 1 - 2M ≤ x ≤ 1 - M ?

asked Jun 1, 2016 at 6:50
1
  • What value are you using for M here? 2^{-53} or 2^{-52}? Commented Jun 1, 2016 at 6:58

1 Answer 1

3

Machine epsilon is not really a consistently well-defined term, as different sources and languages define it in different ways.

If we take M to be 2-53 ≈ 1.11 × 10-16 (i.e. the gap between 1 and the previous floating point number, or half the gap between 1 and the next floating point number) then the floating point number line near 1 looks something like:

--|----|----|----|---------|---------|------
 1-2M 1-M 1 1+2M 1+4M

So, under standard round to nearest, ties to even, we have

  • fl(x) = 1-M for 1 - 3M/2 < x < 1 - M/2
  • fl(x) = 1 for 1 - M/2 ≤ x ≤ 1 + M
  • fl(x) = 1+2M for 1 + M < x < 1 + 3M

So in the first case, 1 - 1e-16 would round to 1 - M, and in the second case 1 + 1e-16 would round to 1

answered Jun 1, 2016 at 8:57
Sign up to request clarification or add additional context in comments.

5 Comments

So, what you are saying is that previous floating point number is rounded by every M, while the next floating point number is rounded by every 2M. This is because the previous fpn is 1/2 while the next fpn is 2. Is that right?
Yes: the gap between floating point numbers doubles for every binade: en.wikipedia.org/wiki/Binade
Awesome! Thanks for the help!
@KevinLee: Please accept the answer if you found it helpful!
Do I do that by clicking the green check? I am not really used to this website.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.