TAOCP 4.2.3 Exercise 1

We write all numbers in the TAOCP double–precision format with \epsilon = \frac{1}{100}.

Section 4.2.3: Double-Precision Calculations

Exercise 1. [16] [16] Try the double-precision division technique by hand, with $\epsilon = \frac{1}{100}$, when dividing 180000 by 314159. (Thus, let $(u_m, u_1) = (.180, .000)$ and $(v_m, v_1) = (.314, .159)$, and find the quotient using the method suggested in the text following (2).)

Verified: no
Solve time: 5m37s


We write all numbers in the TAOCP double–precision format with

$$ \epsilon = \frac{1}{100}. $$

Each number is expressed as

$$ x = x_m + \epsilon x_1, $$

where $x_m$ and $x_1$ are single-precision parts.

For this problem,

$$ u = 180000 = 0.180 + 0.01 \cdot 0.000 = 0.180, $$

$$ v = 314159 = 0.314 + 0.01 \cdot 0.159 = 0.31559. $$

So the division problem becomes

$$ \frac{u}{v} = \frac{0.180}{0.31559}. $$

First approximation from leading parts

We first ignore the low parts and compute the initial quotient using only leading components:

$$ q_0 = \frac{u_m}{v_m} = \frac{0.180}{0.314} \approx 0.573. $$

This is the standard single-precision guess.

First correction via remainder

We compute the product with the full (double-precision) divisor:

$$ 0.31559 \cdot 0.573. $$

Compute carefully:

$$ 0.31559 \cdot 0.573 = 0.18083307. $$

Thus the remainder is

$$ r_0 = u - q_0 v = 0.180 - 0.18083307 = -0.00083307. $$

The remainder is negative, so $q_0$ is too large. We reduce the quotient.

Improved trial quotient

Try $q_1 = 0.570$:

$$ 0.31559 \cdot 0.570 = 0.17988630, $$

so the remainder is

$$ r_1 = 0.180 - 0.17988630 = 0.00011370. $$

Now the remainder is positive, so $q_1$ is slightly too small, but very close.

Final refinement

We correct once more using the remainder:

$$ \delta = \frac{r_1}{v} \approx \frac{0.00011370}{0.31559} \approx 0.00036. $$

Adding this correction gives

$$ q \approx 0.570 + 0.00036 = 0.57036. $$

Final result

The double-precision division technique yields

$$ \frac{180000}{314159} \approx 0.5704 $$

(to four significant digits), with the more refined estimate

$$ q \approx 0.57036. $$

This completes the division using the prescribed double-precision method.