Preserving a small positive result

A program must evaluate r=a2+1−ar=\sqrt{a^2+1}-a at a=108a=10^8. In its arithmetic, a2+1a^2+1 rounds to a2a^2, and the subsequent square root returns aa, so direct evaluation gives zero.


Which expression is algebraically equivalent to rr in exact arithmetic and avoids subtracting nearly equal quantities when evaluated under this rounding model?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Errors and Error Propagation Questions: