Sei sulla pagina 1di 16

1

Chapter

Errors in Numerical
Computations

The solutions of mathematical problems are of two types: analytical and numerical.
The analytical solutions can be expressed in closed form and these solutions are error
free. On the other hand, numerical method is a division of mathematics which solves
problems using computational machine (computer, calculator, etc.). But, for some
classes of problems it is very difficult to obtain an analytical solution. For example, the
Indian populations are known at the years 1951, 1961, 1971, 1981, 1991, 2001. There
is no analytical method available to determine the population in the year, say,
2000.
But, using numerical method one can determine the population in the said year. Again,
sometimes we observed that the solutions of non-linear differential
equations cannot be
determined by analytical methods, but, such problems can easily be solved by
numerical
methods. Numerical computations are almost invariably contaminated by errors,
and
1t 15 important to understand the source,
propagation, magnitude, and rate of growth
of these errors.
ln this age of computer, many complicated and large problems are solved in signifi-
catly Jess táme. But, without using numerical methods we cannot solve any umathemat-
Cal problem using computer, as analytical methods are not
suitable to solve a problem
Dyooputer. Thus, the numnerical methods are highly appreciated
y Mathematicians, Computer Scientists, Statisticians, Engineers and extensively used
and others.

1.1 Sources of Errors

5oution of a problem obtained by numerical method contains some errors. To


ze the errors, it is most essential to identify the causes or sources of the errors
NUMERICALANALYSIS
2 computation. Three Three types oferrors,
numerical
growth and propagation in errors, Occur in findin nesolution
Solui h
and their errors and trurication dise
round-off errors are scussed
inherent errors, numerical method. These three type
of below.
a problem using 15 present in the
statement of tha oblem
errors: This type of
errors simnlieObleniitse.
(i) Inherent Inherent errors occur due to the simplified: sSumption-
solution.
before determining its mathematical modelling of a problem. It can also alsn arise wh
madein the process of measurements of the parameterse of hen
certain physical the propos
data is obtained from
problem.
Round-off errors: Generally, the numerical methods are carried ouf using c
) Une numbers are represon
computer. In numerical ComputatIOn, al
culator or renrec
numbers such as 1/3, 2/3, 1/7 etc. can not be
decimal fraction. Some ted t
decimal fraction in finite numbers of digits. Thus, to get the result, the numbera dnou
be rounded-off into some finite number of digits.
Again, most of the numerical computations are caried out uSing calculator and CO
e
puter. These machines can store the numbers up to some finite number of digits. Sa:
arithmetic computation, some errors will occur due to the finite representation of t
umbers; these errors are called round-off error. Thus, round-off errors occur due to t
finite representation of numbers during arithmetic computation.
These errors depen
on the word length of the computational machine.
(ii) Truncation errors: These errors occur
inherently infinite process. For due to the finite representation of
example, the use of a finite
infinite series to compute number of terms in t
the value of cos o, sin c, e etc.
The Taylor's series expansion
of sinr is

sin =
This is an infinite
series expansion.
31T317
valye of sin z for If only first five pute t.
a given z, then we terms are taken to
Gue to
the truncation of obtain an approximate
error {Etrune) the series. result. Here, tne or ofeu
is given by Suppose, we retain t
terms, the truncäti
the first n terms L

Etrunc 2n+1
It may be noted
that the truncation (2n+1)!
error is independent
1.2 Exact of the computational mac
e compa
and Approximate
To solve Numbers
a problem,
Exact number two types
isclosed to thegives a true valueof numbers are
true value of a result used. They areexa approxim
and approximate
approximate number givos a value
numbo va
For example, in the statements 'a triangle has
three sides', 'there are 2000 people in a
locality', a book has 450 pages the numbers 3, 2000
and 450 are exact numbers. But,
in the assertions 'the height of a pupil is 178 cm', 'the radius of
the Earth is 6400 km',
the mass of a match box is ten gram', the numbers 178, 6400
and 10 are approximate
numbers.
This is due to the impertection of measuring instruments we
use. There are no
absolutely exact measuring instruments; each of
them has its own accuracy. Thus, the
height of a pupil is 178 cm is not absolute measurement.
In the second example, the
radius of the Earth is very concept; actually, the Earth is not
a sphere at all, and we
can use its radius only in approximate terms. In the last example,
the approximation
of the number is also defined by the fact that different bOxes may have
different masses
and the number 10 defines the mass of a particular box.
One important observation is that, same number may
be exact as well as approximate.
For example, the number 3 is exact when it represents
the number of sides of a triangle
and approximate if we use it to represent the number r
when calculating the area of a
circle using the formula rr2. -
Independently, the numbers 1,2,3,,2V2,T, e, etc.
written inthis manner are exact.
An approximate value of is 3.1416, a better approximation
of it is 3.14159265. But
one cannot write the exact value of r.
The accuracy of calculations is defined by the number of digits
in the result which
enjoy confidence. The significant digits or significant figures
of a number are all itš
digits, except for zeros which appear to the left of the first non-zero
digit. Zeros at the
end of a number are always significant digit.
For example, the numbers 0.001205 and
356.800 have 4 and 6 significant digits respectively.
in practical calculations, some numbers occur containing large
number of digits, and
1t will be necessary to
cut them to a usable number of figures. This process is called
rounding-off of numbers. That is, in rounding process the number is replaced by
another number consisting of a smaller number of digits. In that case, one or
several
digits keep with the number, taken from left to right, and
discard all others.
he following rules of rounding-off are commonly used:

5the discarded digits constitute a naumber which is larger than half the unit in the
last decimal place that remains, then the last digit that is left is increased by one.

fthe discarded digits constitute a number which is smaller than halfthe unit in
he last decimal place that remains, then the digits that remain do not change.

f the discarded diqits constitute a number which is equal to half the unit in the
sT decimal place that remains, then the last digit that is half is increased by one,
it is odd, and is unchonged if it is even.
ANALYSIS
4 NUMERICAL

rule is often called a rule of an even digit. If a number is rOa ed


This using
above rule then the number is called
correct up to some (say n) signifco figures.
gures
in t
The following numbers are rounded-off correctly to five significant f
ures:
Exact number Round-off number
25.3678335 25.368
28.353215 28.353
3.785353 3.7854
5.835453 5.8355
6.73545 6.7354
4.83275 4.8328
0.005834578 0.0058346
3856754 38568x 102
a
2.37 2.3700
8.99997 9.0000
9.99998 10.000
From above examples, it is easy
to observe that, while rounding a number, an ero
is generated and this error
is sometimes called round-off error.
1.3 Absolute, Relative
and Percentage Errorsigate1
Let wr be the exact value
of a number and
then we say that the number cA be its approximate value. lf TA
and if zA> c'A is an approximate value of
#T, then it is an approximate the number cT by ae
The diference between value of ar by excess.
the exact value
a
As rule, it is not
possible to determineT and its approximate value TA 3 erro
sign, since the the value of the error
exact umber
The errors are represented uT is unknown. zT-TA
percentage error. in three ways,
viz., absolute error, au
relaui
Absolute error:
The absolute
error of the
inequality approximate
number TA satisfies te
is a quantity (A)
r) which
The absoute Ar 2 TT
error is the
its approximation, upper bound -tAl
i.e., of the deviation fre
of the exact number T7
The above result
can be written r
in the form he
ERRORS IN NUMERICAL
COMPUTATIONS
5
In other words, the absolute
value and approximate value, error of the number
i.e., c is the difference
between true

Ar =T - TAl|
It may be noted firom the rounding
places then process that, if a
umber be rounded to m decimal
absoluteerror
x 10-. (1.2)
The absolute error measures
qualitative one, i.e., only the quantitative
does not show whether aspect of the error but
not the
accurate. For example, the measurement and calculation
the length and the width were
(whose division is 1 cm) of a table are measured
and the following results with a scale
cm and the lengthl = are obtained: the width w =
0.5 cm. It is obvious
1000.5 cm. In both cases the absolute error 5 +0.5
that the second measurement is same and it is
To estimate the quality was more accurate than
of calculations or measurements, the first.
is introduced. the concept of a relative error

Relative error:
The relative error (Sx) of
the number dA is
Ar Ar
or Trl#0 and jcA| # 0.
TA TT
This expression can be
written as
tT = TA(1tor) or tA = atT(1 + ox)
Note that relative error is
the absolute error when measuring 1 unit.
For the measurements of the length and the width
relative errors

ese
are
ow = = 0.1 and dl = 0.5
100
.
of the table (discussed earlier) the

= 0.005.
cases, one can conclude that the measurement of the length of
the table has
relatively more accurate than that of its width. So one conclusion can be drawn:
ETh relative error measures the quantity and quality of the calculation and measurement.
U8, the relative error is a better measurement of error than absolute error.
Percentage error:
The percentage
error of an approximate number c'a is dx x 100%.
It isa particular type of relative error. This error is sometimes called relative
per
tage error. The percentage error gives the total error while measuring 100 unit
of 1
unit. This error also calculates the quantity and quality of measurement.
Cn relative error ia
orT amall then t.he nercentage error is calculated.
ANALYSIS cann
SIgnilicant igures
NUMERICAL
6 n ot be
to
of a number correct
absolute error Exam
Note 1.3.1 The unit in the nth place.
greater than half a to the
independent of the 1:
unit o Solutic
percentage error are
relative error and measuring unit. The ab
Note 1.3.2 The absolute error depends on the
measurement, while The exa
(kamy
relative error and absolute error:
ifference between is bette
error and it 1s the total amount of
erro
ror
Absolute error measures only quantity of
by approximate value. While the
Solutie
relative error measures both the quantity Soluti
incurred
error while measuring one unit. The mumber
and quality of the measurement. It is the total
absolute error depends on the measuring unit, but, relative
error does not depend onTherefc
measuring unit.
and in
The rel
and rel
Example 1.3.1 Find the absolute, relative and percentage error in tA when cT =
In the
and A=0.333. error in
Solution. The absolute error
1.4 V
Ar=rA 0.333 1-0.999
3 A real n=
0.001
9 40000 c-
0.00033.
The relative error

0.00033 S

The peroentage error


TT 1/3 .00099 0.001.
is oz x 100%=
0.00099 x 100% =0.099%
Example 1.3.2
Aproximate An exact
0.1%.
number
the absoluterr is in the interval
value,find
Solution. and the percentagef28.03.28.081.
A The
28.053, middle of the errors. Assumins an valiu
erroro The ahsolute given interval
error is taken as
0.000891.. is half of
A itslength, its approximate V
It is coIrventionia i.e., 1.e
6T =(G.{HXI to round-off A 0.025.
0.025. Tne
The elative i.e., abso
and he percentagethe error
If ine
error to one or obviousE
is 0.097. twoT1on-zero
n digits. Therefore, also vald
ERRORS IN NUMERICAL COMPUTATIONS 7

ample 1.3.3 Determine the absolute error and the exact number corresponding
to the approximate number TA 5.373 if percentage error is 0.010.
Solution. Here the relative error dr = 0.01%= 0.0001.
The absolute error Ar=|cA X ot|=5.373 x 0.0001= 0.00053730.00054.
The exact value=5.373 +0.00054,
Ranple 1.3.4 Find out in which of the following cases, the quality of calculations
15
is better: CT 08824 and yr= V517.141
17
Solution. To find the absolute error, we take the numbers
mumber of decimal digits as tA0.882353, y4V517.141428.
tA and YA with a larger
Therefore, the absolute error in rr is 0.882353 0.8824| 0.000047,
yr
and in is 7.141428. 7.1410.00043.
The relative error in TA is 0.00047/0.88240.00053 0.05%
and relative error in yAis 0.00043/7.141 0.00006020.006%
ww.w.w

In the second case the quality of calculation is better than the first case as relative
error in TT> relative error in yrT

1.4 Valid Significant Digits


A real number can be represented by many different ways. For example, the number
840000 can be represented as two factors: 840x 10 or 84.0 x 10 or 0.840 x 10 (Note .
that in these representations the last three significant zeros are lost). The later form of
the notation is known as normalize form and it is commonly used. In this case, we
Say that 840 is the mantissa of the number and 6 is its order.
vEry positive decimal number, exact as well as approximate, can be expressed as

+
a = d1 x 10 + da x 10 + dn x 10"m-n+I

nete d are the digits constituting the number (i = 1,2,...) with di # 0 and 10-itl
e
ne
value of the ith decimal position (counting from left).
digit du of the approximate number a is valid siguificant digit (or simply a
Valid digit) if it satisfies
the following inequality.

Aa < 0.5 x 10-n+1 (1.3)


i.e., absolute error
does not exceed half the unit of the decinal digit in which da appears.
equality (1.3) is not satisfied, then the digit dn is said to be doubtful. It is
lalso that if the digit d, is valid, then all the prececding digits, to the left of it, are
valid.
8 NUMERICAL ANALYSIS

oie
number is correct up to n signijicant jigures and the first signijican
Theorem 1.1 f a
relative error is less than
digit of the number is k, then the

k x 10n-1

Proof. Let ta be the approximate value of the exact number wT. Also, let ca is Correc
up to n significant figures and m decimal places. Then there are three possibilities ma
occur:
) m <n
(i) m= n and
i) m> Tn.
We have by (1.2), the absolute error Ar 0.5 x 10-".
Case I. When m < n.
In this case, the total number of digits in integral part is
significant digit in zr, then
-
m. If k be the firs

Ar 0.5x10- and wr2 kx 10-m- 0.5 x 10-m.


Therefore, the relative
error

Ar 0.5 x 10-m
T k x 107-m-1-
0.5 x 10-m
1

Since, 7n is a
2kx 10n-1-1
positive integer
and k is an integer
lies between l and
9,
2k 10x
for all k and
n except k =
-1>k x 10-
Hence n = 1.

Case IL. When


In this cawe,
m = n. k 10n-I
itegral part isthe first significant
zero. 'digit is
As beiore, the first digit after
decimal pon
point, i.e., t
0.5 x
10-m
k 10-m-1-0.5
0.5 x 10-
10-m
2kx10-T S 1i
ERRORS IN NUMERICAL COMPUTATIONs 9

an
Case III. When m> n.
T -
this case, the first signiticant digit k is at the (n -m+1) = (m-n-1)th position.
4Iso, the integer part is zero. Then Az 0.5x 10-m and Jzri k x 10-(m-n+1)
0.5 x 10-m
Therefore, 0.5 x 10-m
ec x 10-(m-n+1)- 0.5 x 10-m
ay 1 1

2kx10n-1-1kx 10-1
Hence the theorem.

1.5 Propagation of Errors in Arithmetic Operationss


1.5.1 The errors in sum and difference
Consider the exact numbers X1, X2,.. .,Xn and their approximations be respectively
1, T2 Tn. Let Ar1, Ar2,.,Acn ie., Xi = z; +
,n. Also, let X = X1 be the errors in a1, t2,...,Tn,
.
Ari,i=1,2,.. +X2 +.+Xn and z = #1 +t2 + +Tn.
Therefore, the total absolute error is
|X-al = |(X1- *i) + (X2 -za) + +(X,- #n)
X1-il+ |X2-#2l +*+ |Xn -Tn.
Thus the absolute error in the sum is

e Ar=|Aci|+|Az2|+ + |Ar, (1.4)

Thus the absolute error in sum of approximate numbers is equal to the sum of the
absolute errors of the numbers.
From (1.4), it follows that the absolute error of the algebraic sum must not be smaller
than the absolute error of the least exact termn.
The following points should be kept in mind when adding numbers of different abso-
lute accuracy.

identify a number (or numbers) of the least accuracy (i.e., a number which has
the maximum absolute error),
(ii) more exact numbers so as to retain in them one digit more thn in the
nd-off
dentified number (i.e., retain one reserve digi)
perform addition taking into account all the retained digits,
(iv) round-off
the result by discarding one digit.
NUMERICAL ANALYSIS
10

corresponclin.
Subtraction vnlics of the
two approximate wwets
Consider ) and ra be
Ar are
where Ati and Arg
= t Ar2, theerrora
Then X Ari and A2 t2
t
and r spectivrly.
- a) |X1 zi|+ X, Hene - in
Therefore, 1X r|= |(X1-i)-(X2
Al= [Ar|+ |Arzl.
difference of two numbers is equal to tho. mlivi
Thus the absolute erTor in
absolute errors.

1.5.2 The error in product


exact numbers X1 and A2 and their approximate values.
Let us consider two errorsin æi and T2, 1.e., A1=T1tAr1 and X2=4
Also, let Arj and Ar2 bethe
Now, X1X2 = c172 TiAr2 t tT2Ari t Ati Ar2. richt
T1Ar2|+lc2Ati|+|Az1 Az2|. The last term of
Then X1X2-x1c2| 3
we discard it and dividing both sides by Jz| = Jz12.
side is smal, so
product is
Thus the relative error in the
|X1X2-i2
1T2
of indivic
errors in product of two numbers is equal to the sum
Thus the relative
relative errors. numbers so tha
(1.6) can be easily extended to the product of several
The result
X1X2. Xn and a = t1t2 n, then
X=
An
Tn
tne >u
relative error in product of n numbers is equal to
That is, the total
individual relative errors.

A particular case , = T102 In


1he approximate numbers C1, t2,... be all positive and a
EtThen =
logrlog#1 + log r2 + + log t
Ar Arj , Atn
Theredore,
T1
2 .+
That i numbers
Usually, the toillowing steps are followed when multiplying two
PRRORS IN NUMERICAL COMPUTATIONS 11

G) identify a umber wit.h the least. nuinber of valid


diits
(ii) round oft the remarmng lactors so 1.lhat. they woull contain one
significant digit
more than the valit sigiicant, disgits there are in the isolat.e] nmber.
ii) rotain as many siguilicant. dgits in tlhe procduc:t as there are valicl significani,
digits
in the least oxact lartor (the ideintificd nnber).

,
Example 1.5.1 Show that when an approximate mumber
t is mltiplied by an
act actor the relative error of the product is eqtial to the relative
appraxinnate number t and the absolute eiror is
error of the
absolnte number.
ktimes the absolute error of the

Solution. Let kT where k is an exact factor other than zero. Then

61
But, the absolute error A ATI kATi= k times the absoute error in
******ww*
***

1.5.3 The error in quotient


Let us consider two exact numbers X1 and X2 and
their approximate values Ti and v2.
Aiso. let X = A1
and = x
X2 2
hen X= 71 + Ari, X2 =
l2 + At2, where Ati and Ac2 are the errors.
et 1 #0 and t2 #0.

X- = 1 +Ar1 1 C2 Ari -

t1 At2
2 + Ar2 2
2(2 + Ar2)
Tg tuth sides by s and taking absolute values:

Ari Ar2|
2
.
+Ar||
rr Lrz is sTnall as cnparel to r2, theu approxiately
Therefore, above r:]ation becocs

X Ar Ar2
(1.8)

t.heir91 f is2,
individual
Hence, tJe totanl relalive error in qquotient is equal to the sum of
relative i
ANALYSIS
NUMERICAL
12
also be written as
relation (1.8) can
The
At2 Aa
2
T2

conclude that the relative error in quotient


cumos:.
is greatrg
one can
From this relation their individual relative
errors.
Is. the

difference of
or equal to the
particular case
Å
and 2, the equation (1.8) can easils. 1
For positive approximate numbers 1
dedue-

T1/t2 Then log log t1 logt2. Therefore,


Let

A1 Ara|
ie. 1 T2

while dividing two numbers the following points should be followed.


va
) identify the least exact number, i.e., the number with the least number of
digits,

(i) round-off the other number, leaving in it on significant digit


more than there
digits in the identified number,

i) retain as many significant digits in


the quotient as there were in the least ex
umber.

Example 15.2 Find


the sum of the approximate
UB4, 205.2, 830, 185.3. 0.0863 0.684 0.0881 numbers 0 343, UT00 17.45
digts are valid. Find
the absolute error
in each of which allthe w
in Sum.
oution The least exact
ane
2352 and 185.3, numbers (those
possessing the maximuu absolute erro
s, leasingone
The error of
digit
each of them is 0.05.
more and adding Now,
imum
f the ot
rounas off
11745+0.004205,24-8.35- all of them
bsarding 01e digit 185.3+0.09-+0.68+0.09-4178
e error
by round-off
te in thesum the sum and weobtaiued
consists of obtained 4417.9.
tue
initialerror,
EOBOingerTOTS ie,, the sum
two terimS
SUn of
ofthe other ofthe
the errors of
exact numbers aid
the least exa
the eroru Toundng
s1g the
numbers:
offtheSum
0.05 x 2+0.0000
0.05x 2+0.0005 x8 0.104 .10
1040.10 o
he eannteerror
dfihe gum
benithen as 1s0.10
is 4179412 17.88 0.02.
0.02
A7.94912 0.12
ExamrlgA5.3 Find thedifference of the approximate numbers 27.5 and 35.8 hav
ing absolute errors 0.02 and 0.03 respectively. Evaluate the absolute and the relative
ertors of the result
:

.
:
'

.
.

Solution Let ai 27.5and w2=35.8. Then 2 22 -8.3. The total


absolute error r 0.02 +0.03= 0.05. '
' '.

Thiis the difference i 2 1S8.3 with absolute error 0.05.


Therelative error is 0.05/8.3|0.006=0.6%.

Example 1.5.4 Find the product of the approxiinate numbers 8.6 and T2
84.359, all of whose digits are valid. Also find the relative and
the absolute errors
.
Solution. In the first number, there are two valid significant digits and in the second
there are five digits. Therefore, round-off the second number to three significant
digits. After rounding-off the nümbers ai and: r2 become i 8.6 and 2 =34,4.
Hence the productis

t1t28.6 x 34.4 295.843:010 .


.

.,

In the result, there are two significant digits, because the least number of valid sig
nificant digits of the given numbers is 2. :

The relative error in product is

A A1||Aa 0.05 0:00055


. 0.00583 0.58%.
1 8.6 34.359

The absolute error is (3.0x 102) x 0.005831.7491.7

Example 1.5.5 Calculate the quotient c/y of the approximate numbers r6.845
ad y 2.53 if all the digits of the nuimbers are valid Find the relative and the
absolute errors.
:
,
.
. **

= .
ution. Here the dividendc 6.845 has four valid significant digits and the
Or as thrcc, so we perform division without rounding otf Thus
6.846.845 = 2.71. .

2.53 .
.

eSignificant digits are retained in the result, since, the least exact number (the
A

livisor
The ) contains three valid
significant digits.
absolute error in r and y are respectively **
14 NUMERIGAL
www.w.

quotiont is
relative error in
Hheraore the 0.005
Ay0.0005 0.000073 +0.00198
A G.8456.845 2.53
0.002= 0.2%.
:

Tre absoluteertot is
0.002 2.71x00020.00542 0.005. :
.

1.5.4 The errors in power and in root


Let us consider an approximate number ci which has a relative error ôz, No
problem is to find the relative error of r = c
Then

= = T1 T1* *U1.
m times
By (1.7), the relative error ôx
in the product is

o=da1+ o1+ + ot1=m dt1. (1


m times
Tms, when the approximate
imcTeases number a is raised er
m times. to the power m, 15
I
ve

Salarly, one can calculate


Hese z1 0. Therefore, the relative error
of the number T=
vl
Tras is,
log = -m log r1.

Heice the relative


error is

where or
and brs reRpectively 6=61,
represent
TM

the relative errors


rors i1
in *x and *1.
ANALYSIS containing SCvera
so
NUAIERICAL fiinction var
16 conpnting a
total error for
formula givas the
This
ables. giiwn by
rlative error is
The of Ar

arithmetic compy
Error during
1,6 Significant loss of
digits
significantrepresentation of the
num
bers
the
occurs due to the finite significant digits
digits ocon
ore
Siçniticant error occurs mainly due to oft
error calculator). The loss
taton. 1his machine (computer or
omputational reasons
following two
due to the and
numbers are subtracted dividend.
two nearly equal compared to the
()when small divisor
by a very illustrated in
division is made which are
round-off error,
(i) when
more serious than
Siguificant error is
evaluate the relative
foliowing examples: and
diference X V6.36V5.35
1.6.1 Find the
Exampie
error of the result. V5.352.313 r2
X2
V5.362.315 21 and the approximate
differ
Solution. Let X1 =
and Arz 0.0005. Then
absolute errors Arj = 0.0005
The =0.002.
e is z = 2.315 -2.313 is Ar0.0005 +0.0005 =0.001.
error in the
subtraction
Tae total absoiute
Telative error óz 0.002 0.000.5 = 500
50%.
Te scheme of calculation we get a more accurateresult.
Howerer. by changing the
{V.36-v5.35)(V5.36 + V5.35
= V36- 5.35- V5.36 + V5.35
5.35-5.35 0.01
wew. 0.002=t (say)
V5.36+V5.35 V5.36+ V5.35

In ts ras tie riative errr is


A +Arz 0.001
hr 2.315
+2.3130.0002 = 0.02%.
result
Th, W/n caieiiatitig, 71 and T2 with tie sane four digits we get a Deube
t 74: a :intie ern,
ERRORS IN NUMERICAL COMPUTATIONS 1
va
Example 1.6.2 Calculate the values of the funetion y 1 -- cos c at r = 82° and
at
at 1°. Also, calculate the absoute and the relative errors of the rosults.

Solution. y at r=
82°
The value of cos82 .1392 01 ay) (correct up to four digits) and Aai =
00005. Then y1 1-0.1392 * 0.8608 and Ayi =0.00005 (from an exact num-
her equal to unity we subtract an approxiinate nuuber with an absolute error not
exceeding 0.00005).
Conseqently, the relative error is
mpu
0.00005
oy1 0.006%.
ccun 0.8608 0.000058=
10
at
We have cos (say). Aa2 = 0.00005.
100.9998 a2
2=1- 0.9998 0.0002. Ay20.00005,
Hence
0.00005
n
0y2 0.0002 25 25
ti
a
From this example it is observed that for small values of a, direct calculation of
y= 1-cos gives a relativeerror of the order 25% But at 82° the relative error
tive is only 0.006%
.
Now, change the calculation procedure and use the formula y= 1-cos t=2sin
to calculate the value of y for small values of ww.w
Let a= sin 0 300,0087 Then Aa 0.00005 and
fer 0.00005
0.0087
0.0058 0.58%
Thus y2=2 x0.00872=0.000151 and relative error
oyn = 0.0058 +0.0058 0.012=1.2% (using the formula
õa = 6a + oy if a =ay)
The absolute error is
A

n
= x oyp = 0.000151 x 0.012 0.000002.
Thus a sirnple transformation, of the computing formula,gives a more accurate result
.
for the same
data
Example 1.6.3 Find the roots of the equation x-10002 + 0.25 =0.
ion For simplicity, it is assurned that all the caleulations are performed using
tour significant equation are
digits. The roots of this

1000 106- 1

Potrebbero piacerti anche