0% found this document useful (0 votes)
19 views38 pages

Approximation and Errors in Computing

1. There are various types of errors in computing including roundoff errors from representing numbers with a fixed number of digits, truncation errors from approximating functions, and inherent errors from limitations in measuring data. 2. The accuracy of a numerical value can be indicated by the number of significant digits, while precision refers to the number of decimal places. 3. Errors can accumulate and propagate through computations, potentially leading to unstable and inaccurate results. Careful algorithm design and analysis of conditioning is needed to minimize total errors.

Uploaded by

Raiyan Ashraf
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)
19 views38 pages

Approximation and Errors in Computing

1. There are various types of errors in computing including roundoff errors from representing numbers with a fixed number of digits, truncation errors from approximating functions, and inherent errors from limitations in measuring data. 2. The accuracy of a numerical value can be indicated by the number of significant digits, while precision refers to the number of decimal places. 3. Errors can accumulate and propagate through computations, potentially leading to unstable and inaccurate results. Careful algorithm design and analysis of conditioning is needed to minimize total errors.

Uploaded by

Raiyan Ashraf
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/ 38

Approximation and Errors in

Computing
Mr. Sunanda Das
Assistant Professor, CSE, KUET
Intro
• Errors come in a variety of forms. Some are avoidable and some are
not.
• Data conversion and roundoff errors can not be avoided but human
error can be eliminated.
• By careful analysis and proper design and implementation of
algorithms, we can restrict their effect quite significantly.
Taxonomy of errors
Total Error

Modelling Errors Inherent Errors Numerical Errors Blunders

Missing Human
Information Imperfection

Data Conversion Roundoff Truncation


Errors Errors Errors Errors

Measuring
Method Computing Numerical
Machine Method
Significant Digits
• All computers operate with fixed length of numbers.
• 3.141592653589... … can be represented as 3.14, 3.14159 etc.
• The concept of significant digits has been introduced primarily to
indicate the accuracy of numerical value.

• Roundoff errors: The omission of certain digits from a number results


in roundoff error.
Notion of significant digit
1. All non-zero digit are significant
2. All zeros occurring between non-zero digit are significant
3. Trailing zeros following decimal point, 3.50, 65.0, 0.230 have three
significant digit
4. Zeros between the decimal point and preceding non-zero digit are not
significant. For example, the following number have four significant
digits, 0.0001234, 0.001234, 0.01234
5. When the decimal point is not written, trailing zeros are not
considered to be significant. 4500 my be written as and contrails only
two significant digits. However, 4500.0 contains four significant digit.
• The concept of accuracy and precision are closely related to
significant digits.
• Accuracy refers to the number of significant digits in value 57.396 is
accurate to five significant digits.
• Precision refers to the number of decimal precisions, i.e. the order of
magnitude of the last digit in a value. The number 57.396 has a
precision of .001 or 10-3
Inherent Errors
• Inherent errors also known as input errors.
• Data Errors (empirical error): arises when data for a problem are
obtained by some experimental means and are, therefore, of limited
accuracy and precision.
• Conversion Error( representation error): arises due to the limitation
of the computer to store the data exactly. Ex: 0.1 has non-terminating
binary like 0.000110011…, but computer retains only a specified
number of bits.
Numerical Errors
• Numerical errors (procedural errors) are introduced during the
process of implementation of numerical method.
• Roundoff errors: occurs when a fixed number of digit are used to
represent exact numbers.
• Rounding a number can be done in 2 ways
• Chopping
• Symmetric rounding
• Chopping: The extra digit are dropped. This is called truncating the
number.
• If we use a computer with a fixed word length of 4 digits, then
42.7893 will be stored as 42.78 and 93 will be dropped
• Symmetric Roundoff: last retained significant digit is rounded by 1 if
the first discarded digit is larger or equal to 5. Ex: 42.7893 would
become 42.79
Truncation errors
• Truncation errors arise from using an approximation in place of an
exact mathematical procedure.

is replaced by finite sum


• Modelling Errors.
• Blunders
Absolute and Relative Error
• True value xt = Approximate value xa + Error
• Error = xt – xa
• Magnitude of the error ea = | xt – xa | (absolute error)
• Relative error er =
= =|1-|
Machine Epsilon
• The maximum relative error given above is known as machine epsilon.
• For a computer system with binary representation, the machine
epsilon is given by

• Here base 10 is replaced by 2


• For a machine which uses base b with d-digit mantissa
ERROR Propagation
• Triangle inequality: the magnitude of the absolute error of a sum or
difference is equal to or less than the sum of the magnitudes of the
absolute errors of the operands.

If we neglect the product of error


Sequence of computation
Conditioning and Stability
• There are situations where even a single
operation may magnify the roundoff errors
to a level that completely ruins the results.

• A computation process in which the


cumulative effect of all input errors is
grossly magnified is said to be numerically
unstable.
• The term ‘condition’ is used to describe the sensitivity of problems or
methods to uncertainty. If a small change in x produces a change in
f(x)
• If the condition number is large, then the function f(x) is said to be ill-
conditioned and its computation will be numerically unstable.

• There are different situations when a problem can have a large condition
number.
Minimizing the total error
• The total numerical errors mainly consists of two component,
truncation error and roundoff error.
Pitfalls and Precautions
THE TAYLOR SERIES and Truncation Error
• The theorem states that any smooth function can be approximated as a polynomial
• A useful way to gain insight into the Taylor series is to build it term by term. For example, the first term
in the series is

• This relationship, called the zero-order approximation, indicates that the value of f at the
new point is the same as its value at the old point.
• Equation provides a perfect estimate if the function being approximated is, in
• fact, a constant.

You might also like