# Exercises on Machine Numbers, Rounding Error and Error Propagation

## Contents

# Exercises on Machine Numbers, Rounding Error and Error Propagation#

## Exercise 1#

Verify that when *dividing* two numbers, the relative error in the quotient is no worse than slightly more than the sum of the relative errors in the numbers divided.
(Mimic the argument for the corresponding result on products.)

## Exercise 2#

For \(x = 8.024\) and \(y = 8.006\),

Round each to three significant figures, giving \(x_a\) and \(y_a\).

Compute the absolute errors in each of these approximations, and in their difference as an approximation of \(x - y\).

Compute the relative errors in each of these three approximations.

Then look at rounding to only two significant digits!

## Exercise 3#

(a) Illustrate why computing the roots of the quadratic equation \(ax^2 + bx + c = 0\) with the standard formula

can sometimes give poor accuracy when evaluated using machine arithmetic such as IEEE-64 floating-point arithmetic. This is not alwys a problem, so identify specifically the situations when this could occur, in terms of a condition on the coefficents \(a\), \(b\), and \(c\). (It is sufficient to consider real value of the ocefficients. Also as an aside, there is no loss pr precisio prbe, when th roots are non-real, so you only need consider quadratics with real roots.)

(b) Then describe a careful procedure for always getting accurate answers. State the procedure first with words and mathematical formulas, and then express it in pseudo-code.

This work is licensed under Creative Commons Attribution-ShareAlike 4.0 International