0% found this document useful (0 votes)
13 views

Computer Oriented Numerical Method

Uploaded by

gudduguddu7807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Computer Oriented Numerical Method

Uploaded by

gudduguddu7807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

C O M P U T E R O R IE N T E D N U M E R IC A L M E T H O D

Unit 1
• Introduction
• Measures of Accuracy
• Concept of significant digits
• Repersentation of numbers in memory
• Computer arithmetic
ACCURACY OF NUMBERS
(1) Approximate numbers.
There are two types of numbers: exact and approximate. Exact numbers are 2, 4, 9, 7 2 , 6.45, ...... etc. but there are numbers such that 4 3
(= 1.333 ......), 2 (= 1.414213 ...) and π (= 3.141592......) which cannot be expressed by a finite number of digits. These may be approximated
by numbers 1.3333, 1.4141, and 3.1416, respectively. Such numbers, which represent the given numbers to a certain degree of accuracy, are
called approximate numbers.

(2) Significant digits.


The digits used to express a number are called significant digits. The digits 1, 2, 3, 4, 5, 6, 7, 8, 9 are significant digits. ‘0’ is also a
significant digit except when it is used to fix the decimal point or to fill the places of unknown or discarded digits. For example, each of the
numbers 7845, 3.589, and 0.4758 contains 4 significant figures while the numbers 0.00386, 0.000587, 0.0000296 contain only three
significant figures (since zeros only help to fix the position of the decimal point)

(3) Rounding-off.
This process of dropping unwanted digits is called rounding-off. Numbers are rounded-off according to the following rule:
To round-off a number to n significant digits, discard all digits to the right of the nth digit and if this discarded number is
(i) less than 5 in (n + 1)th place, leave the nth digit unaltered. e.g., 7.893 to 7.89.
(ii) greater than 5 in (n + 1)th place, increase the nth digit by unity, e.g., 6.3456 to 6.346.
(iii) exactly 5 in (n + 1)th place, increase the nth digit by unity if it is odd, otherwise leave it unchanged. e.g., 12.675 ~ 12.68 12.685 ~
REPERSENTATION OF NUMBERS IN MEMORY
There are two types of arithmetic operations available in a computer. They are:
(i) Integer arithmetic (ii) Real or floating point arithmetic.
Integer arithmetic deals with integer operands and is used mainly in counting and as subscripts. Real arithmetic uses
numbers with fractional parts as operands and is used in most computations. Computers are usually designed such that each location, called word,
in memory stores only a finite number of digits. Consequently, all operands in arithmetic operations have only a finite number of digits.
In such a convention, the maximum and minimum possible numbers to be stored are 9999.99 and 0000.01, respectively, in magnitude. This range
is quite inadequate in practice. For this, a new convention is adopted that aims to preserve the maximum number of significant digits in a real
number and also increase the range of values of real numbers stored. This representation is called the normalized floating point mode of
representing and storing real numbers. In this mode, a real number is expressed as a combination of a mantissa and an exponent. The mantissa is
made less than 1 or ≥ .1 and the exponent is the power of 10 which multiplies the mantissa. For example, the number 43.76 × 106 is represented
in this notation as .4376 E 8, where E 8 is used to represent 108. The mantissa is .4376 and the exponent is 8. The number is stored in memory
location as:

Moreover, the shifting of the mantissa to the left until its most significant digit is non-zero is called normalization. For example, the
number .006831 may be stored as .6831 E–2 because the leading zeros serve only to locate the decimal point. The range of numbers that may be
stored is .9999 × 1099 to .1000 × 10–99 in magnitude, which is obviously much larger than that used earlier in fixed decimal point notation. This
ARITHMETIC OPERATIONS
Addition operation
Addition operation is performed on normalized floating–point number if the exponents of the numbers is equal. If the exponents are not equal
the exponent of the number with smaller exponent is made equal to larger exponent and its mantissa is modified.

For example, if 0.7253E2 and 0.5467E5 are to be added, then the decimal point of mantissa of 0.7253E2 is shifted by 3
positions (i.e. 5-2) to left hand side and the exponent is increased by 3. Due to which exponent of both numbers become equal and addition
operation can be operated on them by adding their mantissas.

Example : Add 0.8475E6 to 0.4376E3

Solution : The decimal point of the mantissa of 0.4376E3 is shifted three position to left. It becomes 0.0004, whereas the digits
6, 7, and 3 are chopped off i.e. truncated. The exponent is incremented by 3. Therefore, the number after
normalization becomes 0.0004E6. These numbers can be added now as shown below:

Addend 0.0004E6
Augend 0.8475E6
Sum 0.8479E6
Subtraction operation

Like addition operation, the Subtraction operation is performed on normalized floating–point number if the exponents of the numbers is
equal. If the exponents are not equal the exponent of the number with smaller exponent is made equal to larger exponent and its mantissa is
modified.

During normalization if exponent of difference becomes less than -99 than the system will
show an error because the number is smaller than the smallest number which our hypothetical computers can store. And this situation is
known as underflow.

For example, if 0.7253E2 and 0.5467E5 are to be subtracted, then the decimal point
of mantissa of 0.7253E2 is shifted by 3 positions (i.e. 5-2) to left hand side and the exponent is increased by 3. Due to which exponent of
both numbers become equal and subtraction operation can be operated on them by subtracting their mantissas.

Example : Subtract 0.8475E3 to 0.4376E6

Solution : The number 0.8475E3 is normalized, thus resulting in number 0.0008E6. Now the number 0.0008E6 an
be subtracted from 0.4376E6 as:

Minuend
0.4376E6
Subtrahend
0.0008E6
Difference
0.4368E6
Multiplication operation
In multiplication operation, the mantissas are multiplied and the exponents are added.

In case of multiplication operation, the mantissa of product will not be


in normalized form. For example, if 0.1234E5 and 0.1111E13 are to be multiplied the we directly multiply the mantissa and add the
exponents.

i.e. 0.1234E5 * 0.1111E13 = (0.1234 * 0.1111) E (5+13)

Example : Multiply 0.3754E5 by 0.8576E4

Solution : 0.3754E5 × 0.8576E4 = (0.3754 × 0.8576) E (5+4)


= 0.32194304E9

Thus, we obtain 0.1475E8 after truncating the mantissa of the product to four digits. And this product is already in the normalized form.
Division operation
In Division Operation, the mantissa of first number is divided by the mantissa of the second number and the exponent of second number is
subtracted from the exponent of first number. Note, that the mantissa of the quotient will not be normalized.

Further Note that the magnitude of the quotient may become greater than 1.0, but will always be
less than 10.0. Therefore, at most the decimal point of mantissa of the quotient will be shifted one position to the left and the exponent will be
increased by 1. And as a result of the increase, the exponent can increase up to +99. Now if the mantissa is negative, this results in underflow
or overflow.

Example : Divide 0.9876E-5 by 0.1231E99

Solution : 0.9876E-5 ÷ 0.1231E99 = (0.9876 ÷ 0.1231)E(-5-99)


= 8.02274574E-104

The mantissa of the quotient is greater than 1.0 therefore the decimal point is shifted one position to the left and the exponent is increased by
1. The resultant quotient becomes 0.8022E-103.
Measures of Accuracy : ERRORS

Absolute Error :
Absolute Error is the modulus of the difference between the actual value and the approximate value of the given problem. If x is the
actual value and xa is the approximate value of the problem then the Absolute Error is given by:

Absolute Error = | x – xa|

Example :
Relative Error:
Relative Error is the ratio of the error to the actual value of the problem. If x is the actual value and X a is the approximate value of the problem,
then the relative error is given by:

Relative Error = x – xa

Example :
Percentage Error :
The percent error is calculated by dividing the difference of the estimated value and the original value by the original value and multiplying it with
100.

percentage Error = x –xa 100

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy