0
$\begingroup$

How should I compute the maximum absolute and relative error of the following IEEE-754 floating-point expression?

a.y + (x - a.x) * ((b.y - a.y) / (b.x - a.x))

Also, we assume, that

  • the optimizer leaves the expression in the specified form
  • the default rounding mode (round to nearest even)
$\endgroup$
  • 2
    $\begingroup$ Hint: the absolute error on a sum/difference is the sum of the absolute errors and the relative error on a product/quotient is the sum of the relative errors. $\endgroup$ – Yves Daoust May 29 '18 at 12:27
  • $\begingroup$ Why exactly is this question coming back? $\endgroup$ – gnasher729 Apr 25 at 8:11
0
$\begingroup$

IEEE 754 gives you the maximum relative error of each operation. You have three differences with a maximum relative error each. Multiplication and division adds the maximum relative error of each operand, plus the maximum relative error of the multiplication and division.

Then you have a final addition. If the right hand side is very close to the negative of the left hand side of the "+" then the relative error is unlimited. You'd need to analyse how close to -a.y the right hand side can be.

For absolute error, you convert the relative error of the right hand side into an absolute error.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.