computational error

COMPUTATIONAL
ERROR
Lecture 2: (a) Important theorems
on absolute error and
relative error with proof
(b) General expression
for error.
Theorem 1: The maximum absolute error of an algebraic sum or difference of
several approximate numbers does not exceed to the sum of absolute error of the
numbers, that is, if xi (i=1, 2 … n) be the n approximate numbers and u is their
algebraic sum or difference, then
u
x1 + x2 + .............+ xn
We prove the results for two numbers:
(a) For sum:
Let n1, n2 be approximate numbers to N1, N2 with errors E1, E2, so that
N1= n1+E2, N2= n2+E2, then N1+N2 = (n1 + E1) + (n1 + E2)
= (n1 + n2) + (E1 + E2)
Let N1+N2 = N, n1 + n2=n and N= n + E, then
N= n+ (E1 + E2)
N - n= E1 + E2
E= E1 + E2
or, |E| = | E1 + E2|
or, |E| | E1| + | E2|………………………..(A)
(b) For difference:
N1 – N2 = (n1 – n2) + (E1 – E2)
Let N1 – N2 = N, n1 – n2 = n and N = n + E,
then N = n + (E1 – E2)
N – n = E1 – E2
E = E1 + (- E2)
|E| | E1| +|- E2|
|E| | E1| +| E2|………………………..(B)
(A) and (B) show that the absolute errors in the sum or difference of two numbers
does not exceed the sum of their absolute errors. Similarly the result can be
extended for three and more approximate numbers.
Theorem 2: The maximum relative error for both multiplication and division does
not exceed to the algebraic sum of their relative errors.
(a) For multiplication: Let n1, n2 be approximate numbers to N1, N2 with errors E1,
E2, so that N1N2 = N, n1n2 = n, N = n + E. Then,
N1N2 = (n1 + E1)(n2 + E2)
=n1n2 + E1n2 + n2E2 + E1E2
N1N2 – n1n2 E = E1n2 + E2n2 + E1E2
Neglecting the second order term E1E2 and dividing both sides by n1n2 i.e. n,
one gets
E E1 E 2


n
n1 n 2

(b) For division: let
E
E
E
 1  2
n
n1
n2
= N;
.............................(I)
= n and N – n =E, then
 E2 
1 

 n2 
1
where we have used the binomial theorem and neglected the second and higher
order terms 9assuming they are small). Then

E  E 
E
E
E
 1    2   1  2 .............................(II)
n
n1  n 2 
n1
n2
(I) and (II) shows that relative error in the product of two approximate numbers is
always less than the algebraic sum of their relative errors.
Thus we can evaluate the errors in an arithmetic operation between two or
more numbers/quantities. But the method becomes difficult when the number of
quantities are large and many algebraic operations, together with mathematical
functions, are involved in the calculation. For such cases, we proceed as follows:
Let u=f(x1, x2………xn) be a function of n variables x1,x2………xn. Let i be the
error in the variable xi for i = 1,2………n and be the change, ie, error in u, when
xi becomes xi + I for i = 1,2,………….,n. Then,
u+
= f (x1 +
1,
x2 +
2,……………,xn
+
n)
= f (x1, x2………xn) +
f (x1,x2,………,xn)
2
+
f(x1,x2,………,xn) +………….
(Taylor’s series expansion of n- variables)
As 1,
gets
2,………,
n
are small, neglecting their second and higher order terms, one

Now, the maximum absolute error in u is given by
max.
+
+……..+
that is,
max
The relative error in u will be between
between
and maximum relative error will be