Number Representations & States

"how numbers are stored in computers"

Rounding error of triangle area

The rounding error incurred when using the following formula to compute the area of a triangle:

is at most , provided that subtraction is performed with a guard digit, , and square roots are computed to within ulp.

Discussion

The condition that is true for virtually every real floating-point system. For example, when , ensures that , and when , is sufficient.

A formal way to write the relative error of this expression is