Académique Documents
Professionnel Documents
Culture Documents
2
2
2
2
2
2
Example: 5.72 10 4.65 10 6.19 10 5.72 10 4.65 10 6.19 10
2
2
2
As LHS: 5.72 10 4.65 10 6.19 10
Machine epsilon: Machine epsilon gives an upper bound on the relative error due
to rounding in floating point arithmetic. This value characterizes computer
arithmetic in the field of numerical analysis, and by extension in the subject of
computational science. The quantity is also called macheps or unit roundof, and
it has the symbols Greek epsilon
Error: It is the deviation in a true value to the approximate value.
Types of errors:
Absolute errors: If X is the true value of a quantity and X ' is its approximate value, then
'
Absolute error E a X X
Relative error: If X is the true value of a quantity and X ' is its approximate value, then
Relative error E r
X X'
X
Percentage error: If X is the true value of a quantity and X ' is its approximate value, then
Percentage error E p
X X'
100
X
Classification of errors:
Inherent errors: These errors are already present in statement of a problem before its solution. Such
error arises due to given limitations of the calculators or the computers. This error can be minimized
by taking the good data by high precision computational aids.
Rounding errors: These errors are arises from the process of rounding off the numbers during the
computation.
Rules of round off: To round off a number upto nth significant digits
If n 1 digit is less than 5, then no change in nth digit.
th
If n 1 digit is exactly 5, then if nth digit is even then unchanged otherwise add one in nth
digit.
Truncation errors: These errors are caused by using approximate results or on replacing an infinite
process by a finite one.
Example: A number 3.5236 gives 3.524 which is a roundoff upto 3 decimal place whereas the truncation
upto 3 decimal place gives 3.523
th
Question: Round off the numbers 865250 and 37.46235 to four significant figures and compute E a , E r
, E p in each case.
Solution:
a) Number rounded off to four significant figures 865200
Absolute error Ea X X 1 865250 865200 50
Relative error Er
X X'
50
5.778 105
X
865250
X X'
100 5.778 103
X
b) Number rounded off to four significant figures 37.46
Absolute error Ea X X 1 37.46253 37.46 0.00253
Percentage error E p
Relative error Er
X X'
0.00235
6.27 105
X
37.46235
Percentage error E p
X X'
100 6.27 103
X
y y f x1 x1 , x 2 x 2
f
f
f x1 , x 2 x1
x 2
x2
1
x1
x 2
2!
x1
x 2
f
f
y x1
x 2
x1
x 2
y
y
x1
x 2
x1
x 2
Relative error E r
y x1 y x 2 y
y
y x1
y x 2
4x 2 y 3
and errors in x, y , z be 0.001, compute the relative maximum error in
z4
when x y z 1
2 2
u 8 xy 3 u 12 x y u
16 x 2 y 3
,
4 ,
y
z4
x
z
z
z5
u
u
u
u x y z
x
y
z
3
2 2
8 xy
12 x y
16 x 2 y 3
4 x
z
z
z4
z5
Since x, y , z may be positive or negative, we take the absolute values of the terms on the right side,
Solution: Since
which gives
u max
8 xy 3
12 x 2 y 2
16 x 2 y 3
z
z4
z4
z5
u max
u
0.036
0.009
4
where Rn x
x a
2!
xa
x a n
f n , a x ,
n!
If the series is convergent, Rn x 0 as
x a n 1
n 1!
n 1
a Rn x
Where Rn x
x 2 x3
x n 1
..........
R x
2! 3!
n 1 ! n
xn
e , 0 x
n!
xn x
xn
e and the maximum relative error
n!
n!
1
n!
For six decimal places at x 1 , we have
1 1 6
10 or n ! 2 106 which gives n 10
n! 2
Hence Er max at x 1 is
Hence we need 10 terms of the series in order that its sum is correct to six places of decimal.
Theorems:
If the first significant figure of a number is r and the number is correct to n significant figures, then
the relative error is less than
Er
1
r 10n 1
Er
1
then the number is certainly correct to n
2 10n
1
2 10n
Ea
1
2 10n
X T X A 10n m
If X A is the approximate value of X after truncation of X after m digits, then
XT X A
10 m1
XT
If X A is the approximate value of X after rounding off to m digits, then
X T X A 0.5 10n m
If X A is the approximate value of X after rounding off to m digits, then
X T X A 0.5 10n m
Propagation of error:: Let e n represents the growth of error after n steps of a computation process,
then
If e n n , growth of error is linear
n
If e n , growth of error is exponential.
If 1 , the exponential error grows indefinitely as n
If 0 1 , exponential error decreases to zero.
Errors in Quadrature Formulas:
Trapezoidal rule:
Expand y f x around x x0 by Taylors series, we get
y y0 x x0 y
'
0
x0 h
ydx
x0
y0 h
x0 h
x0
x x0
y0'' ...........
2!
y0 x x0 y
'
0
x x0
2!
y0'' ........... dx
h 2 ' h3 ''
y0 y0 ...........
2!
3!
h 2 '' h3 '''
y0 y0 ...........
2!
3!
1
h y0 y1
2
h2
h2 '
h3 ''
y0 y0 hy0' y0'' ........... hy0
y0
y0 .......
2!
2!
2.2!
1
h
2
x1
ydx A
x0
1 3 ''
h3 ''
1
h
y
.......
y0 ..........
0
12
3! 2.2!
h3 ''
Hence the error in x0 , x1 is
y0
12
h3 ''
Similarly error in x1 , x2 is
y1 and so on.
12
h3
The total error E y0'' y1'' ...... yn'' 1
12
''
''
''
''
Assuming that y X is the largest of n quantities y0 , y1 ,......, yn 1 , we have
b a h y '' X
nh3 ''
E
y X
12
12
2
1
rule:
3
Expand y f x around x x0 by Taylors series, we get
Simpsons
y y0 x x0 y
'
0
x0 2 h
ydx
x0
x0 2 h
x0
x x0
2!
y0 x x0 y
y0'' ...........
'
0
x x0
2!
y0'' ........... dx
1
h
4h 2 '' 8h3 '''
h y0 4 y0 hy0' y0'' ......... y0 2hy0'
y0
y0 .....
2
2!
2!
3!
4h3 '' 2h 4 ''' 5h5 iv
2hy0 2h 2 y0'
y0
y0
y0 .........
3
3
18
2 y0 h
x2
ydx A
x0
h5
4 5 5 iv
h y0 ....... y0iv
90
15 18
h5 iv
Hence the error in x0 , x2 is
y0
90
h5 iv
Similarly error in x2 , x4 is
y2 and so on.
90
h5 iv
The total error E
y0 y2iv ...... y2iv n 1
90
iv
iv
iv
iv
Assuming that y X is the largest of n quantities y0 , y2 ,......, y2 n 1 we have
b a h y iv X
nh5 iv
E
y0 X
90
180
4
1
rule:
3
3h5 iv
y
80