Answers to Exercises - Springer978-1-349-13108-2/1.pdf · Answers to Exercises Chapter 1 1.1.9 1...

16
Answers to Exercises Chapter 1 1.1.9 1.1.10 1.1.11 1.1.12 1.1.13 1.2.6 1.2.7 250 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 13 17 43 26 00000 -16 00001 -15 00010 -14 00011 -13 00100 -12 00101 -11 00110 -10 00111 -9 01000 -8 01001 -7 01010 -6 01011 -5 01100 -4 01101 -3 01110 -2 01111 -1 00000101 -5 00001101 -13 00010001 -17 00101011 -43 00011010 -26 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 11111011 11110011 11101111 11010101 11100110 All sums yield the expected correct results. The results of multiplications are given in the following table: 5 13 17 43 26 5 25 65 85 -41 -126 13 65 -87 -35 47 82 17 85 -35 33 -37 -70 43 -41 47 -37 57 94 26 -126 82 -70 94 -92 The results for the various other sign choices are as expected. Using a simple program we get 8! = -25216. Sixteen factors of 2 are first used in 18! 2. 71828 X 10°, (1.0101101111110000101) 2 X 2 1 , (2.B7E1) 16 X 16°. Representation 1 0 1000 00000000000 2 0 1001 00000000000 3 0 1001 10000000000 4 0 1010 00000000000 5 0 1010 01000000000 6 0 1010 10000000000 10 0 1011 01000000000 20 0 1100 01000000000 40 0 1101 01000000000 70 0 1110 00011000000 100 0 1110 10010000000 Reciprocal 1 0 1000 00000000000 1.2.8 1.2.10 1.2.11 1.3.11 1.3.12 1.3.14 1.3.16 1.3.17 1.3.19 1.3.20 1.4.11 2 0 0111 00000000000 3 0 0110 01010101011 4 0 0110 00000000000 5 0 0101 10011001101 6 0 0101 01010101011 10 0 0100 10011001101 20 0 0011 10011001101 40 0 0010 10011001101 70 0 0001 11010100001 100 0 0001 01000111101 For negatives simply replace the leading bit by 1. The spaces are just to make reading the representations easier and would not be part of the actual representa- tion. For the machine unit, the next representable number greater than 1 is 1 + 2- 11 so that 1-l = 2- 11 for chopping or T 12 for symmetric rounding. Largest representable has binary representation 0 1111 11111111111 which represents (2 - 2- 11 )2 7 = 256 - 1/16. Smallest positive is 0 0000 00000000001 which is (1 + 2-11)2-s. 112 = 1 x z- 1 = (1.0) 2 2-1, 314 = (1 + 112) x 2- 1 = (1.1) 2 2- 1 , 15/8 = (1 + 1/2 + 1/4 + 1/8) X = (1.111) 2 2°, 15.75 = 8 + 4 + 2 + 1 + 1/2 + 1/4 = (1.11111)22 3 . (a) 1-l = 2- 40 for chopping or 2- 41 for symmetric round- ing. Smallest positive is (1 + T 40 )2- 128 , largest is (2 - 2-40)2127. (b) 1-l = T 52 for chopping or 2- 53 for symmetric round- ing. Smallest positive is (1 + 2- 52 )2- 1024 , largest is c 2 _ 2 -52) 2 1023. Representation is (1.100110011 ... 001) 2 T 3 . Error is Error is For IEEE this yields an error of (115)2- 26 . f>(x + y) :$; 0.0055, f>(x y) :$; 0.0062325, f>(xly) :$; 45.15. p(x + y) :$; (4.17)10- 2 , p(x y), p(xly) :$; (4.22)10- 2 . x = 0.0115, y = 0.0114 each rounded to 2 significant figures gives :X= 0.012, y = 0.011, p(x) = p(y) = 0.04, but p(x -·y) = 9. Using an 8-bit mantissa with bias 128, take a = b = -c = 2 127 . Then a(b + c) = 0 but both ab and ac overflow the system. Assuming that both p(a), p(h) :$; then the first loop results in the error bound (n + while the second loop leads only to the bound because there is no error

Transcript of Answers to Exercises - Springer978-1-349-13108-2/1.pdf · Answers to Exercises Chapter 1 1.1.9 1...

Answers to Exercises

Chapter 1

1.1.9

1.1.10

1.1.11

1.1.12 1.1.13 1.2.6

1.2.7

250

0 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 5

13 17 43 26

00000 -16 00001 -15 00010 -14 00011 -13 00100 -12 00101 -11 00110 -10 00111 -9 01000 -8 01001 -7 01010 -6 01011 -5 01100 -4 01101 -3 01110 -2 01111 -1 00000101 -5 00001101 -13 00010001 -17 00101011 -43 00011010 -26

10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 11111011 11110011 11101111 11010101 11100110

All sums yield the expected correct results. The results of multiplications are given in the following table:

5 13 17 43 26 5 25 65 85 -41 -126 13 65 -87 -35 47 82 17 85 -35 33 -37 -70 43 -41 47 -37 57 94 26 -126 82 -70 94 -92 The results for the various other sign choices are as expected. Using a simple program we get 8! = -25216. Sixteen factors of 2 are first used in 18! 2. 71828 X 10°, (1.0101101111110000101)2 X 21, (2.B7E1)16 X 16°. Representation 1 0 1000 00000000000 2 0 1001 00000000000 3 0 1001 10000000000 4 0 1010 00000000000 5 0 1010 01000000000 6 0 1010 10000000000

10 0 1011 01000000000 20 0 1100 01000000000 40 0 1101 01000000000 70 0 1110 00011000000

100 0 1110 10010000000 Reciprocal

1 0 1000 00000000000

1.2.8

1.2.10

1.2.11

1.3.11

1.3.12 1.3.14

1.3.16

1.3.17

1.3.19 1.3.20

1.4.11

2 0 0111 00000000000 3 0 0110 01010101011 4 0 0110 00000000000 5 0 0101 10011001101 6 0 0101 01010101011

10 0 0100 10011001101 20 0 0011 10011001101 40 0 0010 10011001101 70 0 0001 11010100001

100 0 0001 01000111101 For negatives simply replace the leading bit by 1. The spaces are just to make reading the representations easier and would not be part of the actual representa­tion. For the machine unit, the next representable number greater than 1 is 1 + 2- 11 so that 1-l = 2- 11 for chopping or T 12 for symmetric rounding. Largest representable has binary representation 0 1111 11111111111 which represents (2 - 2- 11)27 = 256 -1/16. Smallest positive is 0 0000 00000000001 which is (1 + 2-11)2-s. 112 = 1 x z-1 = (1.0)2 2-1, 314 = (1 + 112) x 2-1 = (1.1)22-1, 15/8 = (1 + 1/2 + 1/4 + 1/8) X 2° = (1.111)22°, 15.75 = 8 + 4 + 2 + 1 + 1/2 + 1/4 = (1.11111)223. (a) 1-l = 2-40 for chopping or 2- 41 for symmetric round­ing. Smallest positive is (1 + T 40)2- 128 , largest is (2 - 2-40)2127. (b) 1-l = T 52 for chopping or 2-53 for symmetric round­ing. Smallest positive is (1 + 2-52)2- 1024, largest is c2 _ 2-52)21023. Representation is (1.100110011 ... 001)2T 3. Error is ~-t/40. Error is ~-t/20. For IEEE this yields an error of (115)2- 26. f>(x + y) :$; 0.0055, f>(x y) :$; 0.0062325, f>(xly) :$;

45.15. p(x + y) :$; (4.17)10-2, p(x y), p(xly) :$; (4.22)10-2. x = 0.0115, y = 0.0114 each rounded to 2 significant figures gives :X= 0.012, y = 0.011, p(x) = p(y) = 0.04, but p(x -·y) = 9. 4~-t. Using an 8-bit mantissa with bias 128, take a = b = -c = 2127 . Then a(b + c) = 0 but both ab and ac overflow the system. Assuming that both p(a), p(h) :$; ~-'• then the first loop results in the error bound (n + 1)~-t while the second loop leads only to the bound 3~-t because there is no error

in the representation of integer quantities. 1.4.12 100,000 terms are needed. Sum of absolute values of

terms is around 12, so overall round-off error (and total error) are bounded by (105 + 12)~-t = 6 X 10-3 •

1.4.13 13 terms needed. Powers of 2 have no error, so round­off error ::; 5 X 10-7 • Total error::; 1.05 X 10-5 •

Chapter 2

2.1.8 The differences are n 1/n "2 diff1 diff2 1 1.0000 -0.7500 0.6111 2 0.2500 -0.1389 0.0903 3 0.1111 -0.0486 0.0261 4 0.0625 -0.0225 0.0103 5 0.0400 -0.0122 0.0049 6 0.0278 -0.0074 0.0026 7 0.0204 -0.0048 8 0.0156

2.1.9 The differences are X f(x) diff1 diff2 diff3 0 1.0000 0.2080 0.0480 0.0480 1 1.2080 0.2560 0.0960 0.0480 2 1.4640 0.3520 0.1440 0.0480 3 1.8160 0.4960 0.1920 4 2.3120 0.6880 5 3.0000

2.1.11 !:!. 4a; = a,+4 - 4ai+ 3 + 6ai+2 - 4ai+ 1 + a;. 2.1.13 The terms are 1, 1/3, 1/5, 117. Their first differences are

-2/3, -2/15, -2/35 which give the second differences 8/15, 8/105.

2.1.15 !:!.ka = (- 2)k(k!) n (2n- 1)(2n + 1) · · · (2n + 2k- 1)

2.2.8 The difference table is X f(x) diff1 diff2 diff3

-1 -8.0000 2.0000 4.0000 18.0000 0 -6.0000 6.0000 22.0000 18.0000 1 0.0000 28.0000 40.0000 18.0000 2 28.0000 68.0000 58.0000 3 96.0000 126.0000 4 222.0000

Chapter 3

3.1.8 3.1.12

3.1.13

3.1.14 3.2.6

3.2.7 3.2.8

3.2.9

3.2.10

3. arctanhx = 'I.i'~ox2i+ 1/(2i + 1), approximationis0.54903 to 5 decimal places. (1/2) 'I./~o (- 1Y(x - :rc/6)2i/(2i)!

+ (V3/2) 'I.;:0 (- 1Y(x - :rc/6?i+1/(2i + 1)! Approximation is 0.5591924, error bound is 9.9 x 10-\ error is 5 X 10-7 •

A suitable bound is 0.0125; 51 terms. 2x = 1 +xln2 + (xln2)2/2! + (xln2)3/3! + ... Bound is (xln2t+ 1[1/{l - x1n2/(N + 2)}]/(N + 1)! Number of terms: need N = 14. 8 terms needed. Bound is x2N+ 3/(2N + 3)(1 - x2). For special case this is 2.9 x 10-4 •

Worst error for x = :rc/4. Hence the relevant deriva­tive is bounded by "'l/3i2 and so uniform bound is ("'l/3i2) (:rc/12)N+1/(N + 1)!. Need N = 4. program e3_2_10; function apsin(t:real):real;

For IEEE, 21 terms are needed with arithmetic per­formed to an extra 6 bits accuracy.

1.4.14 To 4 decimal places the norms are L 1 : 0.1503, L2 :

0.1402, L~: 0.2337. 1.4.15 L 1 : 0.4674, L 2 : 0.3933, L~: 0.5708.

2.2.9

2.2.10

2.3.4

2.3.5

2.3.6

3.3.10 3.3.11 3.3.12

3.3.13

Difference table is X ln(x) diff1 diff2 diff3 diff4

0.50 -0.6931 0.4054 -0.1177 0.0531 -0.0293 0.75 -0.2877 0.2877 -0.0646 0.0239 -0.0115 1.00 0.0000 0.2231 -0.0407 0.0124 -0.0047 1.25 0.2231 0.1824 -0.0283 0.0077 1.50 0.4055 0.1541 -0.0206 1.75 0.5596 0.1335 2.00 0.6931

Difference table is X ln(x) diff1 diff2 diff3 diff4

0.50 -0.6931 0.4055 -0.1178 0.0532 -0.0295 0.75 -0.2877 0.2877 -0.0645 0.0237 -0.0111 1.00 0.0000 0.2231 -0.0408 0.0127 -0.0051 1.25 0.2231 0.1823 -0.0282 0.0076 1.50 0.4055 0.1542 -0.0206 1.75 0.5596 0.1335 2.00 0.6931

The difference between the two tables results purely from the propagated round-off error in the table in Exercise 2.2.9 whereas the differences in this table are computed to greater accuracy and then rounded for output. The fourth and seventh entries should read 1.417 and 2.176 not 1.427 and 2.167. The third entry has a transposition error; it should be 0.7547, not 0.7457. Changing the entry 20.65 to 20.75 has the effect of making the second differences grow steadily and very slowly rather than varying erratically.

var xl, x2:real; begin

xl: =(t-pi/6); x2:=sqr(x1)/2; xl: =x1 *sqrt(3); apsin:=(l +x1-x2*(1 +xl/3-x2/6))/2;

end; var i: integer;

x: real; begin

for i: =0 to 10 do begin x: =(25+ 2•i)•pi/180; writeln( apsin(x): 10:6,sin(x) :10:6);

end; end. Sum is :rc/4. 50,000 terms are needed. 0.3678795. 0.81562 without the transformation. 0.821313 using the Euler transformation. The following program was used to generate the second answer for Exercise 3.3.12:

251

program e3_3_13; const maxterm=8; function term(n:integer):real; begin term:=1/sqr(n+l); end; function E_sum(tol:real):real;

var m,s,t:real; i,j ,sign:integer; diff: array[O .. maxterm] of real;

begin m:=1; s:=O; diff[O]:=term(O); i:=O; sign:=1; repeat

t: =diff[O]*m; s:=s+sign*t; i:=i+1; sign:=-sign; m:=rn/2; diff[i]: =term(i);

Chapter 4

4.1.9 Using initial interval (0.1, 1.5] we get the final interval [0.8875, 0.975].

4.1.10 With initial intervals [-3, -2], (-1, 0], (1.0, 1.4], [1.4, 2.0], we get final estimates -2.28125, -0.46875, 1.15, 1.49375.

4.1.11 Final interval (1.25, 1.3125]. 4.1.12 17 more iterations each. The various solutions obtained

are 0.947747 for Exercise 4.1.9, -2.300000, -0.500000, 1.100000, 1.500000 for Exercise 4.1.10 and 1.256431 for Exercise 4.1.11.

4.1.13 The solutions are: 1 -0.703468 2 -0.407784 0.714806 3.999994 3 -0.288551 0.408958 5.666298 4 -0.223564 0.288841 6.523369 5 -0.182549 0.223671 7.154306 6 -0.154289 0.182594 7.653966 7 -0.133629 0.154320 8.067511 8 -0.117851 0.133644 8.420131 9 -0.105400 0.117851 8.727379

10 -0.095345 0.105415 8.999515 4.1.14 Abbreviated tables of output are as follows:

n=2 n=4 0.0 0.000 0.0 0.000 0.2 1.241 1.268 0.2 1.229 1.274 0.4 1.595 1.640 0.4 1.572 1.602 0.6 1.910 1.935 0.6 1.270 1.309 0.8 1.933 1.963 0.8 1.012 0.982 1.0 1.535 1.571 1.0 0.834 0.785

n=6 n=8 0.0 0.000 0.0 0.000 0.2 1.228 1.253 0.2 1.241 1.271 0.4 1.270 1.309 0.4 1.012 0.982 0.6 0.900 0.873 0.6 0.695 0.654 0.8 0.695 0.654 0.8 0.522 0.491 1.0 0.556 0.524 1.0 0.442 0.393

n = 10 0.0 0.000 0.2 1.214 1.250 0.4 0.834 0.785 0.6 0.556 0.524 0.8 0.442 0.393 1.0 0.353 0.314

252

for j:=i-1 downto 0 do diff[j]:=diff[j+1]- diff[j];

until (abs(t)<tol) or (i>=maxterm); E_sum: =s/2;

end; var eps, sum:real; begin

end.

eps:=1e-6; sum:=E_sum(eps); writeln(sum: 10:6);

3.3.14 -118 without Euler's transformation. - 2/9 using the transformation is the exact sum.

3.3.16 113(2~ for truncation after N terms. 3.3.17 Bound is 11(4Nv'3). N = 11.

4.2.16 0.90930, 0.96945, 0.93301, 0.95674, 0.94186 are the first five iterates.

4.2.17 With g(x) = -0.2 + 4.48/x - 1.63/r - 1.8975/x3 the first four iterates are -2.13136, -2.46478, -2.15919, -2.43598.

4.2.20 lg' (x) I < 1 for x < - 2.15 so that slow convergence follows from the local convergence theorem.

4.2.21 The following program was used for Exercise 4.2.17 with the obvious modification for Exercise 4.2.16: program e4_2_21; function g(x:real):real; begin

g: = -0.2+( 4.48-(1.63+ 1.8975/x)/x)/x; end; var eps,aO,a1:real;

iter:integer; begin

eps:=1e-6; a1:=-2.5; iter:=O; repeat

aO:=al; a1:=g(a0); iter: =iter+ 1; writeln(iter:3 ,a1: 12:8);

until abs(a1-a0)<eps; end. This converged in 140 iterations to -2.300000. For Exercise 4.2.16, 27 iterations gave the solution 0.947747.

4.2.23 We can use A = 0.84 and x0 - x1 ""' 0.09 so that e20 < 0.0172. With this estimate of A, about 80 iterations are needed.

4.2.25 Four Aitken iterations gave agreement to eight decim-als: 0.94774713.

4.2.26 Four Aitken iterations yields agreement to the solution -2.30000000.

4.2.27 Denoting the partial sums by sm we gets~= 1/(1 - x). 4.3.12 First five iterations: 3.607142857, 3.605551627,

3.605551275, 3.605551275, 3.605551275. 4.3.13 The following program was used to generate the results

below: program e4_3_13; function f(x:real):real; begin f: =sqr(x)-13; end;

4.3.14

4.3.15 4.3.16

4.3.18

function df(x:real):real; begin df: =2*x; end; var eps,xO,x1:real;

iter:integer; begin

eps:=1e-8; x1:=3.5;

iter:=O; repeat

xO:=x1; x1: =xO-f(xO)/df(xO); iter: =iter+ 1; writeln(iter:3,x1:12:8); until (abs(x1-xO)(eps);

end. 1 3.60714286 2 3.60555163 3 3.60555128 4 3.60555128 Obvious modifications to the above program yield the converged results: Ex. 4.2.1: Ex. 4.2.16: Ex. 4.2.17:

5 -1.00000000 4 0.94774713 5 -2.30000000

5 iterations suffice in all cases. The following program was used and selected output is reproduced below: program e4_3_16; var c:real; function f(x:real):real; begin f:=cos(x)-c; end; function df(x:real):real; begin df:=-sin(x); end; var eps,xO,x1:real;

i,iter:integer; begin

eps:=1e-8; for i: = -10 to 10 do begin

c: =abs(i/10); x1:=pi/2-c; iter:=O; repeat

x0:=x1; iter: =iter+ 1; if c<1 then x1:=x0-f(x0)/df(x0) else x1=x0-2*f(x0)/df(x0);

until ( abs(x1-x0)<eps); if i<O then writeln( -c:5:1,pi-x1:12:8,iter:4)

else writeln(c:5:1,x1:12:8,iter:4); end;

end. 0.0 0.2 0.4 0.6 0.8 1.0

1.57079633 1.36943841 1.15927948 0.92729522 0.64350111

-0.00000000

1 3 3 4 4 4

The program used was as follows: program e4_3_18; function f(x:real):real; begin f:=cos(x)+1; end; function df(x:real):real; begin df:=-sin(x); end; var eps,xO,x1,x2:real;

dO,d1,r: real; kO,k1,iter:integer;

4.3.19

4.4.9

4.4.10

begin eps:=1e-8; x2:=3; d1:=0; k1:=-10; iter:=O; repeat

x0:=x1; x1:=x2; d0:=d1; k0:=k1; x2:=x1-f(x1)/df(x1); iter:=iter+ 1; d1:=x2-x1; if iter> 1 then begin

r: =dlldO; k1:=round(l/(1-r)); writeln(iter:3 ,x2: 12:8 ,r: 10:4,k1 :3);

end else writeln(iter:3,x2:12:8); until (k1=k0) and (iter2); repeat

x1:=x2; x2:=x1-k1 *f(x1)/df(x1); iter: =iter+ 1; writeln(iter:3,x2:12:8);

until abs(x2-x1)_eps; end. The results for this case were: 1 3.07091484 2 3.10626847 0.4985 2 3 3.12393240 0.4996 2 4 3.14159311 5 3.14159265 6 3.14159265

With appropriate modifications the results for the equa­tion of Example 4.3.7 were: 1 2.37042254 2 2.28206335 0.6819 3 3 2.22220456 0.6774 3 4 2.10114097 5 2.10000010

From (1,1), the next two iterations produce (1, 3/2) and (8/9, 49/36). From ( -1, 1), we get ( -1, 112) and ( -1/2, 1/4). The initial point (1, 3/5) gives a singular Jacobian matrix for the first iteration and therefore breaks down. The routine of Example 4.3.10 appropriately modified, with the initial point (1, 1) converges in 5 iterations to (0.937565, 1.347810). Three iterations from ( -1, 1) re­sults in ( -1.25, 0.375), a point at which the Jacobian matrix is singular. The initial point (1, 0.6) does not produce an exact singular matrix; after 20 iterations the final point is (587,203.6, 1,468,007.0). Using X0 = 3, x1 = 4, the next five iterates are 3.571428571, 3.603773585, 3.605559730, 3.605551273 and 3.605551275. The program used was: program e4_ 4_10; function f(x:real):real; begin f:=sqr(x) - 13; end; var eps,xO,x1,x2:real;

iter:integer; begin

eps:=1e- 6; x1:=3; x2:=4; iter:=1; repeat

xO:=x1; x1:=x2; x2: =x1 - f(x1)*(x1 - x0)/(f(x1) - f(xO)); iter:=iter + 1; writeln(iter:3,x2:12:8);

253

until (abs(x2 - x1) < eps); end.

Ex. 4.2.16 Ex. 4.2.17

6 8

0.94774713 -2.30000000

The results generated were 2 3.57142857

4.4.12 The ratios all settled fairly well after some initial insta­bility. The last few for each case were:

3 3.60377358 4 3.60555973 5 3.60555127 6 3.60555128

4.4.11 The results were: Ex. 4.2.1: 13 -1.00000000

Chapter 5

5.1.7

5.1.9

5.1.10

5.1.11

The next five terms are: -0.200000, 4.520000, -3.430000, 19.364100, -26.227320. We get k uk qk 0 1.000000 -0.2000 1 -0.200000 -22.6000 2 4.520000 -0.7588 3 -3.430000 -5.6455 4 19.364100 -1.3544 5 -26.227320 -3.3938 6 89.010832 For the smallest root we form ratios qk = uJuk+t and get 0 1. 000000 -1.1641 1 -0.859025 -0.2772 2 3.098925 -0.6462 3 -4.795616 -0.4360 4 10.999654 -0.5328 5 -20.645351 -0.4849 6 42.577376 The following program was used: 5.2.6 program e5_1_11; type vee = array(O .. 20] of real; procedure next_term(deg:integer; coeffs:vec; var 5.2.9 terms:vec); var i:integer; begin 5.2.10

for i:=O to deg - 1 do terms[i]:=terms[i + 1];

terms(deg]:=O; 5.3.6 for i:=O to deg - 1 do

terms(deg]:=terms(deg] - coeffs[deg - i]*terms(i]; terms[ deg]: =terms[ deg]/coeffs(O]; 5.3. 7

end; var c,u: vee;

qO,q1,eps: real; d,i,its: integer;

begin d:=4; for i:=O to d - 1 do u(i]:=O; u[d]:=1;

5.3.8

Chapter 6

6.1.9 d = 1, c = 0.1, b = 0.01, a = 0.002. 6.1.10 (a) a = 7, b =I= -2

(b) a= 7, b = -2: y = -(2 + z), x = 2- z (c) z = -3/5, y = 8/5, x = -2/5.

Ex. 4.2.1: 1.5893, 0.2947, 8.5527, 1.7782, 1.5830, 2.1357, 1.9930 Ex. 4.2.16: 0.4399, 2.0851, 0.6894 Ex. 4.2.17: 0.9513, 0.6055, 1.3485, 1.0163, 1.0798

c(0]:=1.8975; c(1]:=1.63; c(2]:=-4.48; c(3]:=0.2; c(4]:=1; its:=O; q1:=20; eps:=5e- 3; write(its:4,u( d] :12:6); repeat

its:=its + 1; q0:=q1; next_ term( d,c,u); q1:=u(d - 1]/u(d]; writeln(q1:10:4); write(its:4,u( d]: 12:6);

until (abs(qO - q1) < eps); end.

The final few results generated were: 5 -20.645351 -0.4849 6 42.577376 -0.5072 7 -83.950783 -0.4967 8 169.020204 -0.5015 9 -337.007939 Using the quadratic formula, roots are 9.995 and 0.1005. Using product of roots (and still chopping) yields 0.1000 for the smaller one. The values of u, v for the next two iterations are: 2.6024, -1.6464 and 2.6000, 1.6499. Other factor (x2 + 2.8024x + 1.1665). Using fo.ur iterations yields converged factors (x2 - 2.6x + 1.65) and (x2 + 2.8x + 1.15) which have roots 1.5, 1.1 and -2.3, -0.5 respectively. Two iterations starting with u = -2 gives final u = -2.329933 and coefficients of the cubic as 1.000000 -2.285821 1.202141 -1.358308. The converged root and coefficients are Iteration 6: -2.300000

1.000000 -2.100000 0.350000 0.825000 Using -0.52 as a starting value for the cubic with coef­ficients given by the previous exercise, the converged root and coefficients of the quadratic are Iteration 4 -0.500000

1.000000 -2.600000 1.650000 The roots of the quadratic are 1.1 and 1.5.

-0.1655 and x = 3.333. With pivoting and exact arithmetic, z = -1, y = 1, x = 1. Using 4 significant figures: z = -1.000, y = 0.9999, x = 1.000.

6.1.11 Results as in Exercise 6.1.9. 6.1.12 Simple algorithm with exact arithmetic breaks down.

With 4 significant figures everywhere, z = 1.001, y =

6.1.13 Results as for previous exercise. 6.2.11 n(n - 1)(m + (2n - 1)/6]. 6.2.12 The corresponding table is

254

Elim. Back

sub. Total

6.2.13

6.2.14 6.2.15 6.3.9 6.3.10

+ -' X

n(n - 1)(5n - 1)/6 n(n - 1)(5n - 1)/6 n2(n- 1)/2 n2(n - 1)/2

n(n - 1)(8n - 1)/6 n(n - 1)(8n - 1)/6

For the same input A and b: Crout reduction:

for i:-1 ton - 1 for j: =i + 1 to n

aii: =a;j /au for k:=i + 1 ton

ajk: =ajk - aji a;k Forward substitution:

for i:-1 ton Y;:=b; for j:=1 to i - 1

Y;:=y;- a;j Yj Y;:=y;/a;;

Back substitution: for i: =n downto 1

X;:=y; for j: =i + 1 to n

X;: =x; - aij Xj d = 1, c = 0.1, b = 0.01, a = 0.002. d = 1, c = 0.1, b = 0.01, a = 0.002. 76.00011, 37.20221, 24.00005. 38.00011, 24.00005.

I n(n- 1)/2

nz

n(3n- 1)/2

Chapter 7

7.1.4 7.1.5 7.1.7 7.2.9 7.2.12 7.2.13

7.3.7

7.3.8

7.4.8

7.4.9 7.4.11

-11.2678. -12.368889 -0.00037 (Horner), 0 (direct), -0.000375 (true). 0.5249, 0.8614, 1.2820. 0.4916, 0.8724, 1.2238, 1.3256. 0.4762, 0.8753, 1.2238, 1.3384. 0.4729, 0.8754, 1.2238, 1.3352. Linear: 0.06, 0.02, 0.105. Quadratic: 0.036, 0.0067, 0, O.o3. Cubic: 0.0135, 0.0005, 0, 0.0135. Quartic: 0.01296, 0.00032, 0, 0.00108. The difference table is 1.0 0.6931 0.8747 -0.3343 0.1429 -0.0596 1.3 0.9555 0.7410 -0.2343 0.0833 1.4 1.0296 0.6473 -0.1760 1.7 1.2238 0.5417 2.0 1.3863 0.8747, 1.1638. The graphs show increasing deviation as x moves away

2.00 ,----------------,

0.00 "---------------___j

0.50 2.50

Exercise 7.4.11

6.3.11 6.3.13

6.3.14

6.4.8 6.4.9

6.4.10 6.4.12 6.4.13 6.5.8

6.5.9

6.5.10

6.5.12

6.5.13

7.4.12

K1(A)~ 3.8 X 106 , K~(A) ~ 4 X 106 •

Exact: (1, 1, 1, 1). Computed: (0.799995, 0.800005, 0.799997, 1.20000). Residuals: -10-7 x (5.7, 9.1, 12.6, 13.4). 1-norm: 1.4 X 10-14 $ 0.2 $ 0.205. oo-norm: 1.4 X 10-14 $ 0.200005 $ 0.223. (2, 2, 2, 0), 1-norm: 2.6 X 10-7 $ 1 $ 3.8 X 106 •

oo-norm: 2.5 X 10-7 $ 1 $ 4 X 106 •

(1.7, 1.2, -1.4, 1.0); (1.86, 0.97, -1.96, 0.9). (1. 7, 1.03, -1.843, 0.9783); (1.9656, -0.9921, -1.9902, 1.0006). 5 iterations (2.0000,1.0000, -2.0000, 1.0000). Optimal parameter close to 1.05. 4 iterations gives exact solution to high accuracy. Eigenvalues are -1 and 3 with eigenvectors (1, -1) and (1, 1) respectively. The next three vectors (after normalizing) are (5/12, 7112), (19/36, 17/36), (53/108, 55/108) and the eigen­values estimates are 3, 3 and 3 exactly. After 15 iterations the estimate was still moving slowly around 10.83. See Exercise 6.5.13 for more accurate estimate. Exercise 6.5.8, two eigenvalues in [ -1, 3]. Exercise 6.5.10, two in [8, 26], one each in [ -4, 6] and [-11, -5]. Using shifts of 11, 10.5, 1 and -8, convergence to eigenvalues 11.0132, 10.5259, 1.1377 and -8.4392 was achieved in 4, 5, 4 and 5 iterations respectively.

from the interval spanned by the nodes. + indicates original function, d is interpolant. The two graphs in (a) and (b) below are for 11 equally spaced nodes -5, ... , 5. Both usee= 0.001, first with maximum degree 5 then 10.

1.20 ,-----,--------, 1.20 ...,-------,---.,..,

-0.50 '------'----__J -0.50 L_ __ ___J ___ --::-"

-5.00 5.00 -5.00 (a) 5.oo (b)

1.20 ,-----,--------,

·0.50 t__ __ ___JL.__ __ ___j -0.50 '---------'---_J -5.00 5.00 -5.00 5.00

(c)

Exercise 7.4.12 (a) Maximum degree 5; (b) maximum degree 10; (c) Chebyshev nodes, c = 0.0001; (d) Chebyshev nodes -all nodes.

(d)

255

7.5.6

7.5.7

The graphs shown in (c) and (d) are for the Chebyshev nodes, first using the tolerances of the exercise then using all nodes. Po.t = f[xt]; P1.2 = f[xo] + (x - Xo) f[xo, Xz]; Pz.z = f[x0] + (x - X0 ) f[xo, x1] + (x - Xo)(x - Xt) f[xo, X1, Xz]. The array using points in the order 1.3, 1.0, 1.4, 1. 7 is

0.1 0.9555 -0.2 0.6931 0.8680

0.2 1.0296 0.8814 0.8747 0.5 1.2238 0.8884 0.8738 0.8753

Chapter 8

8.1.6 No; Yes quadratic; No. 8.1.8 s' not continuous at 2.

Add 2(x - 2) to s2(x). 8.1.9 0.5288, 0.8531. 8.1.11 The graphs of the linear and quadratic splines are

shown. They are almost indistinguishable at this size, with the quadratic, of course, having more curvature.

0.00 "----------------1.00 3.00

Exercise 8.1.11

8.2.9 x3/2- 4(x - 1) + 2.5x on [0,1]. -(x- 2)3/2- 2.5(x- 2) + 4(x - 1) on [1,2]. -(x- 2)3/2 - 4(x - 3) + 5.5(x- 2) on [2,3]. (x - 4)3/2 - 5.5(x - 4) + 4(x - 3) on [3,4].

8.2.12 The graph for the Chebyshev nodes is shown below.

-0.25 L__ _____ L-----~

-4.00 4.00

Exercise 8.2.12

8.2.13 The graphs below are for uniform nodes (a) and Cheby­shev nodes (b).

256

7.6.9 tan( -0.2) = -0.2027 to 4 decimals places. 7.6.10 0:8418, 0.8423.

True value 0.8428 all to 4 decimal places. 7.6.12 tan ( -0.2) = 0.202628.

tan (0.7) = 0.843223. Both results are seriously contaminated by use of data from the rapidly changing regions of the tangent function.

(a)

Exercise 8.2.13 (a) Uniform knots; (b) Chebyshev knots.

(b)

8.3.7 The coefficients are:

8.3.8

8.3.9

A; B; 0.66667 3.33333 0.33333 2.66667 0. 00000 4. 00000

-0.33333 5.33333 -0.66667 Coefficients are:

(a) A; -0.85714

0.71429 0.00000

-0.71429 0.85714

(b) A; -0.27381

0.54762 0.08333

-0.88095 1.44048

B; 4.85714 2.28571 4.00000 5.71429

B; 4.27381 2.45238 3.91667 5.88095

C; 2.66667 4.00000 5.33333 4.66667

C; 2.28571 4.00000 5.71429 3.14286

C; 2.45238 3.91667 5.88095 2.55952

The two graphs are shown below. (Integer knots in part (a).)

1.25,--------,---,

4.00

(a)

Exercise 8.3.9 (a) Integer knots; (b) Chebyshev knots.

4.00

(b)

8.3.10 The two graphs below are almost indistinguishable. (Not-a-knot in part (a).)

1.20 ,--------,------, 1.20 ,--------,------,

(a) (b)

Exercise 8.3.10 (a) Not-a­knot; (b) complete spline.

Chapter 9

9.1.8

9.1.9

9.1.11 9.2.10 9.2.11 9.2.12 9.2.13 9.2.14 9.2.15 9.2.16 9.3.8 9.3.9 9.4.9 9.4.10

9.4.13 9.4.15

1.7183, 0.8731 + 1.6903x, 1.0130 + 0.8511x + 0.8392x2 •

1.1752, 1.1752 + 1.1036x 0.9965 + 1.1036x + 0.5363x2 , 0.9965 + 0.9980x + 0.5363x2 + 0.1761x3

K 1 2:: 18. 1, x - 1/2, x2 - x + 1/6, x 3 - 3x2/2 + 3x/5 - 1120. 1, x, 3x2 - 4, 5x3 - 12x (or scalar multiples). 1, x - 2/5, x2 - 8x/9 + 8/63. 1, x, x2 - 113, x 3 - 3x/5. 1, x, x2 - 1/2. 1t /2 (n 2:: 1), 1t (n = 0). (e - 1/e)/2, 3/e, (5/2)(e - 7/e), (7/2)(37/e - 5e). bk = 0, a0 = n, a2k = 0, azk+t = -41(2k + 1)2n. ak = 0, bk = ( -1)k+t (2/k). 3x2/4 + 114. Polynomials: 1, x, x2 - 519; coefficients: 2/3, 0, 3/4. Coefficients: 1.22432, 0, -0.18381, 0. Even coefficients: 1.2646, 0.4332, -0.0942, 0.0465, -0.0317, 0.0267; odd coefficients all zero.

Chapter 10

10.1.8 Forward: 0.95310180, 0.99503309, 1.00000125. 1.00503359, 0.99999943. 1.00000033,

0.99950033,

10.1.9

10.1.12

10.1.15

10.2.10 10.2.11 10.2.12

0.99995002, 0.99999515, Backward: 1.05360516, 1.00050033, 1.00004999, 1.00000489, 1.00335348, 1.00003334, 1. 00000000' 1.00000002, 1.00000034. -1.00503358,-1.00004997 -0.99999761, -0.99971658,-0.97315933, 1.81898940. Using h = 1/4, 1116, 1/64, ...

h f'(1) 2.5E- 01 -0.2444444444 6.3E- 02 -0.2495543672 1.6E- 02 -0.2499701849 3.9E- 03 -0.2499981038 9.8E - 04 -0.2499998810 2.4E- 04 -0.2499999925 6.1E- 05 -0.2500000000 tJ = 2-zs

f"(O) 1.5238095238 1. 9373925000 1.9950596616 1.9996714592 1. 9999761581 2 0 0000000000 1. 9997558594

4tJ/h {j = z-zs hopt '= (3tJ/ M)113 , emin = (3/2)(MtJ2/3)113 where M is a bound on the third derivative.

Chapter 11

11.1.8 (3/4)[(1/3) + (1/4)[(1), 1.5490.

8.4.15 The table below shows errors and ratios of these to the first error column as in Example 8.4.5. The pattern is again broadly consistent with an O(h4) error. 0.1 4.2E - 01 9.8E - 04 431 9.5E - 04 445 0.6 1.9E - 01 2.2E - 02 9 1.9E - 03 100 1.1 3.3E- 02 5.3E- 03 6 7.8E- 04 42 1.6 1.2E - 01 8.9E - 03 13 1.3E - 04 894 2.1 l.lE - 01 1.4E - 03 78 5.1E- 05 2070 2.6 5.2E - 02 1.8E - 03 29 8.4E - 06 6250 3.1 1.3E- 02 3.7E- 04 35 4.9E- 06 2594 3.6 6.6E - 02 9.2E - 04 71 4.8E - 07 137576 4.1 8.9E - 02 3.2E - 04 279 2.8E - 06 31433 4.6 6.4E - 02 1.4E - 03 47 7.5E - 06 8561

9.4.17 Cosine coefficients all -0.6981; sine coefficients -1.9181, -0.8320, -0.4031, -0.0123.

1.00

0.00 '--------~L..._ ____ _

-1.00 1.00

Exercise 9.4.15

Approximate values: 0.0045, 10-5 •

10.2.13 hopt = (M/M)113 , emin = (36MtJ2 ) 113 where M is a bound on the third derivative. Approximate values: 0.0056, 3 X 10-5 •

10.3.8 -f(x + h) + 8f(x + h/2) - 8f(x - h/2) + f(x - h) 6h

lf(x + h) - 40f(x + h/2) + 256f(x + h/4)1

- 256f(x - h/4) + 40f(x - h/2) /90h - f(x- h)

10.3.9 1.098612 1.021651 0.995998 1.005258 0.999793 1.000046

10.3.11 -1.15073 -1.03262 -0.99325 -1.00789 -0.99965 -1.00008

10.3.12 Results for E = 10-7 :

0.4943080 0.4985733 0.4999951 0.4996431 0.4999997 0.5000000 0.4999108 0.5000000 0.5000000 0.5000000

11.1.10 2/3, [<4>(x) = 0 whenever it is defined - but f is not

257

differentiable at 0 so the error formula is invalid. 11.1.11 [7/( -1) + 32/( -1/2) + 12f(O) + 32/(112) + 7/(1)]/45,

1.02222. 11.1.13 0.60653, 0.68394, 0.63233. True: 0.63212

Error bounds: 0.04167, 0.08333, 0.00035. 11.1.14 0.15154. 11.2.11 0.882604, 0.869163. 11.2.12 0.864956, 0.864683. 11.2.15 Trapezoid bounds: 1124, 1196

Simpson bounds: 0.0007, 0.000044. 11.2.16 N = 82, computed value 0.864708

true value 0.864665, error< 10-4 •

11.2.17 N = 11 intervals, (23 points) computed 0.8646650, true 0.8646647 error < 10-6 •

11.2.18 0.6532877. 11.3.8 Array is

1.135335

Chapter 12

12.1.10 12.1.11 12.1.12

[4.1, 13.7]. [7.3, 13.7]. Final bracket [7 .3667, 7 .4333] 19 evaluations total (8 for bracket) 66 needed for fixed step. [7.38902, 7.38910], 33 evaluations. 7.38906 in 9 iterations. 7.38905 in 2 iterations.

12.1.13 12.1.15 12.1.16 12.2.8 Contours graphed are for 1/4, 112, 1, 2, 4, 8

Gradient (-4, 0) Hessian [ 1~ i]x1 = (1, -3).

3.00 ,-,-------.,-------,---r---r-o--r-;TTl

-1.00 t__ _ ___.:~.____~__-----''------L'-'---"L_____j

-2.00

Chapter 13

13.1.10 2.17192.

2.00

Exercise 12.2.8

13.1.11 2.18508, 2.21093; errors 0.051, 0.025; ratio 0.49. 13.1.14 For IEEE single precision h""' 0.00073; using N = 211 ,

y(2) ""' 2.23583. 13.1.15 The graphs are shown in the figure. The curves gra-

dually converge to the right of the inflection point. 13.2.12 2.24115, 2.23663; errors -0.005, -0.0006. 13.2.13 2.25039, 2.23920; errors -0.014, -0.003. 13.2.14 2.24711, 2.23832; errors -0.011, -0.0023. 13.2.15 2.23820, 2.23681, 2.23625. 13.2.16 2.236626, 2.236134, 2.236076. 13.2.17 y(1/2) ""' 1.11816, y(1) ""' 1.41440, y(3/2) ""' 1.80294,

y(2) ""' 2.23620.

258

11.3.9

11.3.10 11.3.11 11.4.6 11.4.7 11.4.8 11.4.9 11.5.8 11.5.9 11.5.11 11.5.13

12.2.9 12.2.10

12.2.11 12.2.12 12.3.9 12.3.12 12.3.15

12.4.7 12.4.8

12.4.9

0.935547 0.868951 0.882604 0.864956 0.864690 0.869163 0.864683 0.864665 0.864665 Next row: 0.865790 0.864666 0.864665 0.864665 0.864665 0.14849566 using 33 points. 0.62053755 using 17 points. 25 evaluations, 0.864665. 25 evaluations, 0.864665. 65 evaluations, 0.864664717. 61 evaluations, 0.14849550. 5. 2. 2.3427' 2.35034, 2.350401. Nodes: 0.415775, 2.294280, 6.289945 Weights: 0.711093, 0.278518, 0.010389 Approximation: 0.495934.

X2 = (1, 1). (a) (1, 1) 2 iterations;(b) (1, 1) 2.iterations;(c) (1, 1) 6 iterations. (-0.1649, -0.67024). (1.00000, 1.00000), 5 iterations. Iterates (0, 1), ( -4, 3). Iterates (-1, 2), (-4, 3). Iterates: (1.24432, 1.65297), (1.25288, 1.59806) (1.02464, 1.00501), (0.99486, 0.98593) (0.99423, 0.98678), (0.99922, 0.99974) (1.00014, 1.00038), (1.00015, 1.00036) (1.00002, 1.00001), (1.00000, 0.99999). Iterates: (1/5, 115), (3, -1). Dimension, number of iterations and solution: 3 3 1.0000 1.0000 1.0000 6 6 0.9999 ).0015 0.9952 1.0031 1.0043 0.9959 9 9 1. 0000 1. 0000 1.0000 1.0002 0. 9997 0.9998 1.0003 1.0005 0.9996

12 12 1.0000 1.0000 1.0000 1.0000 1.0001 1.0000 0.9998 0.9999 1.0000 1.0002 1. 0002 0 0 9998

15 14 1.0000 1.0000 1.0002 0.9996 1.0001 1.0003 1.0001 0.9998 0.9997 0.9998 1.0000 [ 1.0002 1.0003]1.0001 0.9996

3 -3 1 Inverse is -3 5 -2 .

1 -2 1

0.00 L...oo<=.L--------------'

0.00 4.00

Exercise 13.1.15

13.2.18

13.2.19

13.3.11 13.3.12 13.3.13 13.3.14 13.3.15 13.3.16 13.4.8

13.4.10

13.4.11

13.4.12

2.2361998, 2.2360750, 2.2360684; errors 1.3 x 10-4 , 7 x w-6 , 4.2 w- 7 •

Graphs are: (a) modified, (b) corrected Euler; (c) Heun, (d) RK4.

Ia) (b)

3.00 ~--------"]

(c)

Exercise 13.2.19 (a) Modified Euler; (b) corrected Euler; (c) Heun's method; (d) RK4.

2.25044. 2.23266. 2.23512. 2.23597. 2.236111, 2.236075. 2.236069.

4.00 (d)

y(0.5) = 1.00, y(l.O) = 1.25, y(1.5) = 1.75, y(2) = 2.50. y(0.5) = 1.1250, y(l.O) = 1.5117, y(1.5) = 2.1587, y(2) = 2.6753. Table of values: 1.1250 1.1259 1.1269 1.5117 1.5230 1.5278 2.1587 2.1659 2.1696 2.6753 2.5526 2.5155 Table of results: 1. 00000 1.00000 1. 00000 1.12744 1.12744 1.12744 1.52991 1.52991 1.52991 2.17128 2.17121 2.17120 2.50201 2.50189 2.50188

13.5.6

13.5.7 13.5.8 13.5.9 13.6.12

13.6.13

13.6.15

13.6.20

a = 0: y(2) = 2.50188, a = 1: y(2) = 6.54162 so a = -0.12424 and y(2) = 1.99999. Using N = 64 steps, a = 0.40758. y(O) = -0.09848. y(O) = -0.47018. 1. 0 1. 00000 1.5 2.0 1.85072 2.5 3.0 1.31634 3.5

1.60852 1.73548 0.69743

4.0 0.01516 4.5 -0.58953 5.0 -1.00000 0.0 1.00000 0.5 1.38174 1.0 1.48218 1.5 1.56891 2.0 2.00000 k = 1:

1 1 26.41145 2 31.04852 3 10.08828 4 -19.18904 5 -32.64635 6 -19.18904 7 10.08828 8 31.04852 9 26.41145 k = 1/2:

1 1 18.47002 2 21.71281 3 7.05492 4 -13.41926 5 -22.83020 6 -13.41926 7 7.05492 8 21.71281 9 18.47002 k = 1/4:

2 -42.73462 -50.23756 -16.32317

31.04852 52.82290 31.04852

-16.32317 -50.23756 -42.73462

2 -29.88512 -35;13207 -11.41510

21.71281 36.94004 21.71281

-11.41510 -35.13207 -29.88512

0.0 1.0000 0.9239 0.5 0.6065 0.5736 1.0 0.3679 0.3509 1.5 0.2231 0.2136 2.0 0.1353 0.1298 k = 118:

0.7071 0.4441 0.2735" 0.1670 0.1015

0.3827 0.2416 0.1494 0.0914 0.0556

0.0 1.0000 0.9239 0.7071 0.3827 0.5 0.6065 0.5681 0.4378 0.2377 1.0 0.3679 0.3459 0.2675 0.1456 1.5 0.2231 0.2101 0.1627 0.0886 2.0 0.1353 0.1275 0.0987 0.0538 k = 0.01: 0.0 1.0000 0.9239 0.7071 0.3827 0.5 0.6065 0.5623 0.4312 0.2336 1.0 0.3679 0.3413 0.2619 0.1419 1.5 0.2231 0.2071 0.1589 0.0861 2.0 0.1353 0.1256 0.0964 0.0522

259

260

Index

A-conjugate 204 Absolute error 7, 10

first-order estimates 10 Acceleration of convergence 40 Adams methods 224

Adams-Bashforth 224 Adams-Moulton 224

Adaptive quadrature 184 Aitken's !12 method 40 Aitken's iterated interpolation 110 Aitken's lemma 109 Alternating series 28

convergence test 28 Euler's transformation 29 truncation error 29

Approximation error 11 Arctangent series 23 Augmented matrix 70

B-spline 131 Back substitution 70 Backward difference 15

differentiation formulas 161 interpolation 112

Bairstow's method 62-5 algorithm 63

Bandwidth 239 Bernoulli's method 59 Biased exponent 5 Binary digit.. 1 Binary representation

floating-point 4, 5 integer 1

Bisection method 34 algorithm 35 convergence 35

Bit 1 Boundary value problems 234-47

diffusion equation 240 finite difference methods 239 linear differential equation 239 Poisson's equation 239 shooting method 234

Bracket 193 Bracketing 193

Central difference 15 differentiation formulas 160 interpolation 112

Characteristic polynomial 92 Chebyshev nodes 103 Chebyshev polynomials 103-4, 145

Clenshaw's algorithm 145 Cholesky factorization 77 Chopping 6 Chord 52 Clenshaw's algorithm 145 Complemented forms 1 Complete spline 126 Complex roots 62 Composite integration formulas 177 Condition number 82 Conjugate directions 204

minimization theorem 205 Conjugate gradient method 204

linear equations 87, 208 minimization 205

Continuous least squares 137 trigonometric 150 weighted 144

Convergence basic theorem 39 bisection method 35 function iteration 39 Newton's method 46

Convergence factor 42 Convergence rate 40

linear 40 quadratic 40 superlinear 53

Crank-Nicholson method 241 Crout reduction 76 Cubic search 194

Data error detection 20 Defective 92

Deflation 65 Degree of precision 187 Diagonal matrix 77 Diagonally dominant 87, 122 Difference operators, .::\,V, 6 15 Difference tables 17

accuracy checks 18 error detection and correction 20 formation 17 growth of error 20

Differences 15 backward 15 central 15 divided 105-6 forward 15 of polynomials 18

Differential equations 213-49 boundary value problems 234-46 diffusion equation 240 Euler's method 213-14 finite .difference methods 239 higher-order equations 231 initial condition 214 multistep methods 224 partial 239 Poisson's equation 239 predictor-corrector 225 Runge-Kutta methods 218 shooting methods 234 systems 231

Differentiation 160 Diffusion equation 240 Dimensionless 112 Direction field 214 Discrete Chebyshev approximation 153 Discrete Fourier transform 154 Discretization error 164, 214 Divided difference 52, 105

differentiation formulas 160 interpolation 106

Doolittle factorization 76-7 Double root 47

Eigenvalue 92 dominant 92 multiplicity 92

Eigenvector 92 Equations

iterative solution 34-57 linear systems 69 non-linear systems 47 polynomial 58

Errors first-order estimates 10 global 10 order 130

propagation 7 relative 7, 10 rounding, round-off 6 total 10 truncation 10, 26

Euclidean norm 82 Euler's method 213

corrected Euler 218 modified Euler 218 round-off error 215 systems 231 truncation error 214

Euler's transformation 29 Explicit methods 224 Exponent 4

bias 5 Extrapolation 101

Richardson extrapolation 166

Factorization of matrices 76-7 Fibonacci numbers 54, 59, 194 Fibonacci search 194 Finite difference methods 239-47

backward difference method 241 Crank-Nicholson 241 diffusion equation 240 forward difference method 240 linear ordinary differential

equation 239 Poisson's equation 239

Finite termination property 205 Fixed-point iteration 39

convergence 39 Floating-point representation 4

binary 4 error 6-7 exponent 4 fraction, mantissa 4 hidden, implicit bit 4 IEEE standards 4, 5 normalized 4 properties 7, 8

Forward difference 15 differentiation formulas 161 interpolation 111-12

Forward elimination 70 Forward substitution 78 Fourier coefficients 151 Fourier polynomial 151 Function iteration 39

acceleration 40 convergence 39 rate of convergence 40

Function norms 11

Gauss central difference formula 112

261

262

Gauss elimination 69 operation count 76 partial pivoting 71

Gauss-Seidel iteration 87 Gaussian quadrature 187

Gauss-Chebyshev 188 Gauss-Laguerre 190 Gauss-Legendre 188

Geometric series 23 differentiation and integration 23 truncation error 26

Gerschgorin's theorem 93 Global error 10 Global truncation error 214 Golden mean 53 Gradient vector 200 Gradual underflow 5

Heat equation 240 Hessian matrix 200 Heun's method 218 Hexadecimal 4 Hidden bit 4 Higher-order initial value problems 231 Hilbert matrix 138 Horner's rule 98-9

IEEE arithmetic 4, 5 double precision 4 single precision 4

Ill-conditioned 84, 138 Implicit bit 4 Implicit methods 224 Implicit trapezoid 224 Initial condition 214 Inner product of functions 143

weight function 144 Integer overflow 2 Integer representation 1 Integer types 3 Integer wraparound 2 Intermediate Value Theorem (IVT) 34 Interpolation 98, 118

Aitken's algorithm 109-10 backward difference formula 112 central difference formula 112 dimensionless forms 112 divided difference formula 106 forward difference formula 112 Lagrange 100 linear 100 polynomial 98-117 spline 118-36

Interpolatory quadrature 172 Inverse iteration for eigenvalues 92 Iterated interpolation 110

Iterative methods 34 bisection 34 convergence 39 linear equations 86

Iterative refinement 83

Jacobi iteration 86 Jacobian matrix 47

Knots 118 Kronecker 0 100

L1 , L2 , L= norms 11 Lagrange basis polynomials 100 Lagrange interpolation 100

error bound 103 remainder 103

Laguerre polynomials 147 Least squares approximation 137-59

continuous 137 discrete 153 normal equations 138 trigonometric 150 weighted 144

Least squares norm 11 Legendre polynomials 145 Line search 200 Linear convergence 40 Linear equations 69

conjugate gradient method 208 consistent 70 inconsistent 70 nonsingular 70 singular 70 square 70 triangular system 76 tridiagonal 121-2 underdetermined 72

Linear extrapolation 52 Linear interpolation 52 Lipschitz continuous 39, 214 Local truncation error 214 Logarithm series 23 Longint 3 Lower triangular 76 LU factorization 76

Machine unit 5 relative error 7

Mantissa 4 Matrix

augmented 70 defective 92 diagonally dominant 87 factorization 76 invertible 70

norms 82 positive definite 77 rank 70 singular 70 square 70 triangular 76 tridiagonal 121

Maximum norm 11, 82 MAXINT 3 Mesh points 239 Midpoint rule 173 Minimum energy property 130 Modified Newton method 200 Monic 104, 144 Multiple roots 47 Multistep methods 224-31

Adams-Bashforth 224 Adams-Moulton 224 algorithm 225-6 orders 224 predictor-corrector pair 225

Negation of integers 1 Newton interpolation

backward difference formula 112 divided difference formula 106 forward difference formula 112

Newton's method 45 convergencetheorems 46 derivations 45 failure 46 for optimization 200

modified 200 multiple roots 47 systems 47

Newton-Cotes formulas 173 Newton-Raphson 45 Nodes 100, 172

Chebyshev 103 Normal equations 138 Norms

offunctions 11 of matrices 82 of vectors 82

Not-a-knot condition 126 Numerical differentiation 160-71

difference formulas 160-1 discretization error 164 one-sided formulas 161 optimal steplength 164 Richardson extrapolation 166 round-off error 164 truncation error 164

Numerical integration 172-92 adaptive quadrature 184 composite formulas 177

degree of precision 187 Gauss-Chebyshev 188 Gaussian 187 interpolatory quadrature 172 midpoint rule 173 Newton-Cotes formulas 173

errors 173 nodes 172 number of intervals 178 quadrature weights 172 Romberg integration 182 Simpson's rule 173 trapezoid rule 173 undetermined coefficients J87 weighted 187

Objective function 193 Operation counts

Doolittle factorization 78 Gauss elimination 76 polynomial evaluation 98

Optimal steplength for differentiation 164

Optimization 193-212 bracketing 193 conjugate gradient method 204 cubic search 194 Fibonacci search 194 modified Newton method 200 Newton's method 200 quadratic search 194 single variable methods 193

Order of error 130 Origin shift 93 Orthogonal polynomials 143

Chebyshev 145 discrete 153 evaluation of expansion 144-5 Laguerre 147 Legendre 145 trigonometric 150

Overflow 5 Over-relaxation 87

Partial differential equations 239 Partial pivoting 71

multipliers 71 Periodic function 150 Permutation vector 71 Piecewise linear 118 Piecewise polynomial 118 Pivot 71

column 71 element 71

Poisson's equation 239

263

264

Polynomial equations 58-68 Bairstow's method 62-5 Bernoulli's method 59 complex roots 62 deflation 65 quadratic factors 62 recurrence relations 58-9

Polynomial evaluation 98 Polynomial interpolation 98-117

Aitken's algorithm 110 divided difference 106 error 103 finite difference 112 Lagrange 100 linear 100

Positive definite 77, 204 Positive definite quadratic function 204 Power method 92 Power series 23

truncation error bounds 26 Predictor-corrector methods 225 Propagation of error 7

Quadratic convergence 40 Quadratic factors 62 Quadratic search 194 Quadrature 172

Rank 70 Rates of convergence 40 Rayleigh quotient 92 Recurrence relation 58

homogeneous 58 linear 58 polynomials and 59

Relative error 7 machine unit and 7 propagation 7

Relaxation coefficient 87 Residual vector 82, 208 Richardson extrapolation 166

numerical differentiation 167 Romberg integration 182 Rounding, symmetric 6 Rounding error, round-off error 6 Runge-Kutta methods 218-24

classical 219 corrected Euler 218 Heun's method 219 modified Euler 218 systems 232

Search direction 200 Secant line 52 Secant method 52 Series 23

alternating 28-9 geometric 23 Taylor 23-4 truncation error 26, 29

Shift operator, E 15,29 Shooting methods 234-8 Shortint 3 Simpson's rule 173

adaptive Simpson quadrature 184 composite 177

SOR method 87 Splines 118-36

B-splines 131 complete 126 cubic 121 definition 118 end-conditions 121 error bounds 130 linear 118 minimum energy property 130 natural cubic 121 not-a-knot condition 126

Steplength 111 differentiation 164

Successive over-relaxation 87 Superlinear convergence 53 Support 131 Symmetric rounding 6 Systems of differential equations 231-2 Systems of linear equations 69-91 Systems of non-linear equations

Newton's method 47

Taxicab norm 82 Taylor series 23-4

truncation error 26 Taylor's theorem 24 Total error 10 Trapezoid rule 173

composite 177 Tridiagonal system 121, 239 Trigonometric polynomials 150

orthogonality 151 Truncated power function 130-1 Truncation error 10

alternating series 29 bounds for series 26 global 214 local 214

Two's complement 1 arithmetic 2, 3

Underdetermined 72 Underflow 5

gradual 5 Undetermined coefficients 187

Uniform norm 11 Unimodal 193 Upper triangular 76

Vandermonde matrix Vector norms 82

101

Weight function 144, 187 Wordlength, integer 1

types 3 Wraparound 2

265