I'm given this set of floating point numbers:
And I'm given the function:
I'm then asked to find the value of f for:
So I've done this:
Now my guess is that I need to convert the exact value (1.666...) into a representable value according to the floating point numbers I'm allowed to work with. Rounding it up I get:
Now again I guess I need to round 1.000167 to 1.00 (maybe I should have already rounded 0.000167 to 0.00 ?):
f(x2) is 0 as well. And to be honest I doubt that the exercise required me to calculate 2 values only to find out they're both 0. Also because it then asks me to find the relative error in both cases and explain the differences. It also asks me to find an alternate form to avoid loss of significance but that's not what I'm posting this question for.
What I need to know is: is the function really 0 in both cases? Am I right when rounding the partial operations? Or should I maybe round at the end?