12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

errors & uncertainties in computations 35other. Because we add the errors in absolute value, this same rule holds for multiplication.Equation (2.13) is just the basic rule of error propagation from elementarylaboratory work: You add the uncertainties in each quantity involved in an analysisto arrive at the overall uncertainty.We can even generalize this model to estimate the error in the evaluation of ageneral function f(x), that is, the difference in the value of the function evaluatedat x and at x c :So, forE = f(x) − f(x c)f(x)≃df (x)/dx(x − x c ). (2.14)f(x)f(x)= √ df1+x,dx = 1 1√2 1+x(2.15)⇒ E ≃ 1 1√ (x − x c ).2 1+x(2.16)If we evaluate this expression for x = π/4 and assume an error in the fourth placeof x, we obtain a similar relative error of 1.5 × 10 −4 in √ 1+x.2.1.4 Round-off Error Accumulation After Many StepsThere is a useful model for approximating how round-off error accumulates in acalculation involving a large number of steps. We view the error in each step as aliteral “step” in a random walk, that is, a walk for which each step is in a randomdirection. As we derive and simulate in Chapter 5, “Monte Carlo Simulations,” thetotal distance covered in N steps of length r, is, on the average,R ≃ √ Nr. (2.17)By analogy, the total relative error ɛ ro arising after N calculational steps each withmachine precision error ɛ m is, on the average,ɛ ro ≃ √ Nɛ m . (2.18)If the round-off errors in a particular algorithm do not accumulate in a randommanner, then a detailed analysis is needed to predict the dependence of the erroron the number of steps N. In some cases there may be no cancellation, and theerror may increase as Nɛ m . Even worse, in some recursive algorithms, where theerror generation is coherent, such as the upward recursion for Bessel functions,the error increases as N!.Our discussion of errors has an important implication for a student to keep inmind before being impressed by a calculation requiring hours of supercomputertime. Afast computer may complete 10 10 floating-point operations per second. This−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!