The Chemistry Maths Book, Second Edition

(Grace) #1

560 Chapter 20Numerical methods


The quantityε


a

ε


b

can be ignored for small enough errors, and the error bound of the


product isε


p

1 = 1 aε


b

1 + 1 bε


a

. Division byp 1 = 1 abthen gives


(20.2)


EXAMPLE 20.2Ifa 1 = 1 12.35andb 1 = 1 2.345have been rounded to 4 figures, determine


the error bounds forq 1 = 1 a 2 b.


We have12.35 2 2.345 1 = 1 5.26652(to six figures). The absolute and relative error bounds


for aareε


a

1 = 1 0.005andr


a

1 = 1 ε


a

2 a 1 ≈ 1 0.0004; and for bthey areε


b

1 = 1 0.0005and


r


b

1 = 1 ε


b

2 b 1 ≈ 1 0.0002. We expect the quotient to haver


q

1 = 1 r


a

1 + 1 r


b

1 ≈ 1 0.0006. Thus the


largest and smallest values of the quotient are (with results quoted to 6 figures)


Thenr


q

1 ≈ 1 0.0033 2 5.26652 1 ≈ 1 0.0006, as expected from equation (20.2). This is the


relative error for the unrounded product.


The answer may be written as5.2665 1 ± 1 0.0033.


0 Exercise 5


The bounds computed in the ways described above are examples of worst-case


bounds. In practice, particularly when floating point arithmetic is used, there is


nearly always some cancellation of errors, and the results of sequences of arithmetic


operations are expected to have smaller actual errors. Rounding errors are examples


of the ‘random errors’ discussed in Chapter 21 and are amenable to statistical analysis.


Differencing errors


By far the most severe errors arising from the use of rounded numbers occur when


two almost equal numbers are subtracted. Thus,a 1 = 1 1.234andb 1 = 1 1.233, rounded


to 4 figures, have a 1 − 1 b 1 = 1 0.001with error bound 0.001 (a 1 − 1 b 1 = 1 0.001 1 ± 1 0.001).


Differencing errors can however often be minimized by the use of an appropriate


numerical procedure (algorithm).


EXAMPLE 20.3Find the solutions of the quadratic equationx


2

1 − 136 x 1 + 121 = 10 using


4-figure arithmetic.


The solutions of the general quadratic equationax


2

1 + 1 bx 1 + 1 c 1 = 10 are


(20.3a)
x

b


a


b


a


c


a


x


b


a


b


a


1

2

2

2

22 22


=− +







 −







,=−−









 −








c


a


12 345


2 3455


5 26327 5 26652 0 00325


.


.


=. =. −.


12 355


2 3445


5 26978 5 26652 0 00326


.


.


=. =. +. ,


r


pab


rr


p

p
ab

ab

==+=+


ε


εε

Free download pdf