Subtract nearly equal rounded inputs

An engineering script tests a simplified binary floating-point format with five significant binary digits, including the leading one. Normal values have the form


(−1)s(1.b1b2b3b4)2×2e.(-1)^s(1.b_1b_2b_3b_4)_2\times 2^e.


The exponent range is sufficient for every value in this problem. Each input is rounded independently to nearest, ties to even, before subtraction. The subtraction result is then rounded using the same rule.


The exact reference inputs are x=12.3 mmx=12.3\ \text{mm} and y=12.1 mmy=12.1\ \text{mm}. Find the stored value of each input and the computed difference d^=x^−y^\widehat d=\widehat x-\widehat y. Report each stored input in millimetres to one decimal place and the computed difference in millimetres to two decimal places.


Also find the absolute relative error of the computed difference, as a percentage to one decimal place, using


∣d^−(x−y)∣∣x−y∣×100%.\frac{|\widehat d-(x-y)|}{|x-y|}\times 100\%.
Your answers

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 Floating Point Numbers Questions: