{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture4 - Lecture 4 Controlling Error and Conditional...

This preview shows pages 1–2. Sign up to view the full content.

Lecture 4 Controlling Error and Conditional Statements Measuring error If we are trying to Fnd a numerical solution of an equation f ( x ) = 0, then there are a few di±erent ways we can measure the error of our approximation. The most direct way to measure the error would be as: { Error at step n } = e n = x n - x * where x n is the n -th approximation and x * is the true value. However, we usually do not know the value of x * , or we wouldn’t be trying to approximate it. This makes it impossible to know the error directly, and so we must be more clever. ²or Newton’s method we have the following principle: At each step the number of signiFcant digits roughly doubles. While this is an important statement about the error (since it means Newton’s method converges really quickly), it is somewhat hard to use in a program. Rather than measure how close x n is to x * , in this and many other situations it is much more practical to measure how close the equation is to being satisFed, in other words, how close f ( x n ) is to 0. We will use the quantity r n = f ( x n ) - 0, called the residual , in many di±erent situations. Most of the time we only care about the size of

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

lecture4 - Lecture 4 Controlling Error and Conditional...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online