574 ANSWERS (Cedant web hosting) TO EXERCISES 4.2.2 ul < 0

574 ANSWERS TO EXERCISES 4.2.2 ul < 0 < 1~~ and 2)~ < 0 < v,; in the latter case we compute four products, and the answer is [min(ul v We, 1~~ v vl), max(ul A wi, u7 A vY)].) Finally, u @ v is undefined if 2ri < 0 < v,; otherwise we use the formulas for multiplication with 01 and w,. replaced respectively by v, and VT , where z A y. = xLAy, xvy- = xvy, (*0)-l = jy20, (+m)-1 = *o. [Cf. E. R. Hansen, Math. Comp. 22 (1968), 374-384. An alternative scheme, in which division by 0 gives no error messages and intervals may be neighborhoods of co, has been proposed by W. M. Kahan. In Kahan s scheme, for example, the reciprocal of [-1, +l] is [+I, -11, and an attempt to multiply an interval containing 0 by an interval containing co yields [-co, fco], the set of all numbers. See Numerical Analysis, Univ. Michigan Engineering Summer Conf. Notes No. 6818 (1968).] 25. Cancellation reveals previous errors in the computation of u and w. For example, if E is small, we often get poor accuracy when computing f(~ + E) 8 f(z), because the rounded calculation of f(x + t) destroys much of the information about E. It is desirable to rewrite such formulas as E @ g(x, E), where g(x, E) = (f(x + E) - f(x))/6 is first computed symbolically. Thus, if f(x) = x2 then g(x, E) = 2x + 6; if f(x) = fi then g(z, E) = l/( fi $ &). 26. See Math. Comp. 32 (1978), 227-232. SECTION 4.2.3 1. First, (wm, wl) = (.573, .248); then wmul/vm = .290; so the answer is (.572, ,958). This in fact is the correct result to six decimals. 2. The answer is not affected, since the normalization routine truncates to eight places and can never look at this particular byte position. (Scaling to the left occurs at most once during normalization, since the inputs are normalized.) 3. Overflow obviously cannot occur at line 09, since we are adding two-byte quantities, or at line 22, since we are adding four-byte quantities. In line 30 we are computing the sum of three four-byte quantities, so this cannot overflow. Finally, in line 32, overflow is impossible because the product fiLfv must be less than unity. 4. Insert JOV OFLO; ENTI 0 between lines 03 and 04. Replace lines 21-22 by ADD TEMP(ABS) ; JNOV *+2; INCl 1 , and change lines 28-31 to SLAX 5; ADD TEMP; JNOV *+2; INCI 1; ENTX 0,l; SRC 5 . This adds five lines of code and only 1, 2, or 3 units of execution time. 5. Insert JOV OFLO after line 06. Change lines 22, 31, 39 respectively to SRAX 0, I , SLAX 5 , ADD ACC Between lines 40 and 41, insert DECZ 1; JNOV DNORM; INC2 1; INCX 1; SRC 1 . (It s tempting to remove the DEC2 1 in favor of STZ EXPO , but then INC2 1 might overflow rI2!) This adds six lines of code; the running time decreases by 3u, unless there is fraction overflow, when it increases by 721. 6.DOUBLE STJ EXITDF Convert to double precision: ENTX 0 Clear rX. STA TEMP LD2 TEMP(EXP) rI2 + e. INC2 QQ-Q Correct for difference in excess.

Leave a Reply