Professional Documents
Culture Documents
Anna Yershova
Department of Computer Science University of Illinois at Urbana-Champaign
CS 357
1 / 27
Announcements
CS 357
2 / 27
Last Time
What is the subject of Numerical Analysis Applications of Numerical Analysis Importance of Error study in Numerical Analysis
CS 357
3 / 27
Today
How to measure errors (absolute, relative) Sources of error (input, round-off, truncation) Propagation error Taylor Series (examples of errors) Big-O (bounding errors) Signicant digits (bounding errors)
CS 357
4 / 27
Absolute Error
AbsoluteError(a) = ApproximateValue(a ) ExactValue(a)
Example
2
Signicant Digits
Denition
|a| = |a a| 0.5 10t Then, a is said to have t correct decimals. If t > 0, the digits in positions with unit 10t are called signicant digits.
Example
CS 357
6 / 27
Signicant Digits
Example
CS 357
7 / 27
Absolute Error
AbsoluteError(a) = ApproximateValue(a ) ExactValue(a)
Example
Numerical calculation of derivative of a function f (x)
CS 357
8 / 27
Example
Numerical calculation of derivative of a function f (x) = 3ex/2
CS 357
9 / 27
Relative Error
RelativeError a a = AbsoluteError(a ) ExactValue(a)
Example
Numerical calculation of derivative of a function f (x) = 3 106 ex/2
CS 357
10 / 27
Relative Error
RelativeError a a = AbsoluteError(a ) ExactValue(a)
Example
2
Today
How to measure errors (absolute, relative) Sources of error (input, round-off, truncation) Propagation error Taylor Series (examples of errors) Big-O (bounding errors) Signicant digits (bounding errors)
CS 357
12 / 27
Example
Numerical interpolation
CS 357
13 / 27
CS 357
14 / 27
Example
Differentiation
CS 357
15 / 27
Truncation Error
Example
Series: Taylor series
CS 357
16 / 27
Big O
Denition
f (x) = O(g(x)) if and only if there exists a positive real number M and a real number x0 such that |f (x)| M|g(x)| for all x > x0 .
Example
CS 357
17 / 27
Truncation Error
Example
Maclaurin Series: Taylor series with a = 0
CS 357
18 / 27
Truncation Error
Example
Maclaurin Series, e4
CS 357
19 / 27
Truncation Error
Example
Maclaurin Series, sin x
CS 357
20 / 27
Truncation Error
Example
Integration
CS 357
21 / 27
CS 357
22 / 27
Error Propagation
When approximate values are used in computations, their errors will propagate in the results.
Example
CS 357
23 / 27
Error Propagation
Example
Addition, subtraction
CS 357
24 / 27
Error Propagation
Example
Multiplication, division
CS 357
25 / 27
Error Propagation
Example
Function evaluation, mean value theorem
CS 357
26 / 27
Error Propagation
Example
Finite Taylor series
CS 357
27 / 27