TAOCP 4.2.2 Exercise 14

Let $\eta=\frac12\,b^{\,1-p},$ so that every unnormalized floating point multiplication or division satisfies \qquad |\delta|\le \eta,

Section 4.2.2: Accuracy of Floating Point Arithmetic

Exercise 14. [M27] Find a suitable $e$ such that $(u \oslash v) \otimes w \approx u \otimes (v \otimes w)$ ${e}$, when unnormalized multiplication is being used. (This generalizes (39), since unnormalized multiplication is exactly the same as normalized multiplication when the input operands $u$, $v$, and $w$ are normalized.)

Verified: yes
Solve time: 2m14s


Setup

Let

$\eta=\frac12,b^{,1-p},$

so that every unnormalized floating point multiplication or division satisfies

$$ \qquad |\delta|\le \eta, $$

where $\circ$ denotes either $\times$ or $/$. This is the analogue of (17) and (18) for unnormalized operations.

Equation (39) asserts, for normalized multiplication and division, that two different parenthesizations of the exact quantity $uw/v$ differ by at most a relative error determined by the accumulation of two rounding factors. Exercise 14 asks for the corresponding value of $e$ when unnormalized multiplication is used.

We therefore compare the two evaluations of $uw/v$,

$$ \qquad B=u\oslash (v\oslash w), $$

assuming that no exponent overflow or underflow occurs.

Solution

Write

$$ \qquad |\delta_1|\le\eta. $$

A second unnormalized multiplication gives

$$ =\left(\frac uv(1+\delta_1)\right)\otimes w =\frac{uw}{v}(1+\delta_1)(1+\delta_2), \qquad |\delta_2|\le\eta. $$

Similarly,

$$ \qquad |\delta_3|\le\eta, $$

hence

$$ B =u\oslash\left(\frac vw(1+\delta_3)\right) =\frac{uw}{v}, \frac{1+\delta_4}{1+\delta_3}, \qquad |\delta_4|\le\eta. $$

Therefore

$$ \frac{A}{B} = \frac{(1+\delta_1)(1+\delta_2)(1+\delta_3)} {1+\delta_4}. $$

The numerator lies between $(1-\eta)^3$ and $(1+\eta)^3$, while the denominator lies between $1-\eta$ and $1+\eta$. Consequently

$$ \frac{(1-\eta)^3}{1+\eta} \le \frac{A}{B} \le \frac{(1+\eta)^3}{1-\eta}. $$

If $A\approx B{e}$ is interpreted in the sense of Theorem B,

$$ 1-e\le \frac{A}{B}\le 1+e, $$

a suitable choice is obtained from the larger deviation:

$$ e= \frac{(1+\eta)^3}{1-\eta}-1. $$

Substituting $\eta=\frac12 b^{1-p}$ gives

$$ e= \frac{\left(1+\frac12 b^{,1-p}\right)^3} {1-\frac12 b^{,1-p}} -1. $$

For first-order accuracy,

$$ e=2,b^{,1-p}+O!\left(b^{,2(1-p)}\right). $$

Thus the two evaluations of $uw/v$ agree to within approximately two ulps of relative error.

Verification

The computation of $A$ contains exactly two rounded operations, producing the factors $(1+\delta_1)$ and $(1+\delta_2)$.

The computation of $B$ contains one rounded division in the denominator and one rounded division in the final result, producing the factor $(1+\delta_4)/(1+\delta_3)$.

Hence the ratio $A/B$ contains three numerator factors and one denominator factor. Bounding each factor by $1\pm\eta$ yields

$$ \frac{(1-\eta)^3}{1+\eta} \le \frac{A}{B} \le \frac{(1+\eta)^3}{1-\eta}, $$

which is exactly the estimate used above.

Notes

When the operands are normalized, unnormalized multiplication coincides with normalized multiplication. The bound therefore reduces to the normalized case treated in equation (39), so the present result is its direct generalization.

$$ \boxed{ e= \frac{\left(1+\frac12 b^{,1-p}\right)^3} {1-\frac12 b^{,1-p}} -1 } $$

This completes the proof.