When demonstrating that one way of writing the function is better than another, should we compute and compare the relative errors of their outputs?
If so, I’m finding this difficult as my example input is in terms of machine epsilon.
When demonstrating that one way of writing the function is better than another, should we compute and compare the relative errors of their outputs?
If so, I’m finding this difficult as my example input is in terms of machine epsilon.
I did not go as far as computing relative error.
I think that something like that would require that you know the exact value of the expression and this may be difficult.
Just find an x for which, when the given form is computed, the computed result is certainly wrong, while, when the alternative form is computed, the computed result is reasonable. No need to quantify further in this case.
Recall that 1+Emach is computed as > 1, and 1 + something_less_than_Emach is computed as 1.