Sunteți pe pagina 1din 144

Numerical Analysis-Topic Two: Errors

Mbigili, L.J

March 28, 2017

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 1 / 44


Outline for section 1

1 Errors in Computations
Introduction
Sources of Errors
Errors in Numerical Computations
Human Error
Inherent errors
Truncation Errors
Rounding Errors
Absolute and Relative Errors
Significant digits
General Error Formula
Function Approximation
Stability and Condition

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 2 / 44


Introduction

Introduction
Numerical methods are methods for solving problems on
computers by numerical calculations, often giving a table of
numbers and/or graphical representations or figures.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 3 / 44


Introduction

Introduction
Numerical methods are methods for solving problems on
computers by numerical calculations, often giving a table of
numbers and/or graphical representations or figures.
Numerical methods tend to emphasize the implementation of
algorithms.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 3 / 44


Introduction

Introduction
Numerical methods are methods for solving problems on
computers by numerical calculations, often giving a table of
numbers and/or graphical representations or figures.
Numerical methods tend to emphasize the implementation of
algorithms.
The aim of numerical methods is therefore to provide systematic
methods for solving problems in a numerical form.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 3 / 44


Introduction

Introduction
Numerical methods are methods for solving problems on
computers by numerical calculations, often giving a table of
numbers and/or graphical representations or figures.
Numerical methods tend to emphasize the implementation of
algorithms.
The aim of numerical methods is therefore to provide systematic
methods for solving problems in a numerical form.
The process of solving problems generally involves starting from
an initial data, using high precision digital computers, following
the steps in the algorithms, and finally obtaining the results.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 3 / 44


Introduction

Introduction
Often the numerical data and the methods used are approximate
ones.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 4 / 44


Introduction

Introduction
Often the numerical data and the methods used are approximate
ones.
Hence, the error in a computed result may be caused by the errors
in the data, or the errors in the method or both.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 4 / 44


Introduction

Introduction
Often the numerical data and the methods used are approximate
ones.
Hence, the error in a computed result may be caused by the errors
in the data, or the errors in the method or both.
If not carefully treated, the errors will continue propagating from
one step after another and eventually will lead to a wrong
approximation.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 4 / 44


Introduction

Introduction
Often the numerical data and the methods used are approximate
ones.
Hence, the error in a computed result may be caused by the errors
in the data, or the errors in the method or both.
If not carefully treated, the errors will continue propagating from
one step after another and eventually will lead to a wrong
approximation.
For this reason it is important in numerical analysis to do error
analysis for each technique used and decide which technique is
better than the other in approximating the solution to the
problem.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 4 / 44


Sources of Errors

Definition
How can we define an ERRORin computation?

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 5 / 44


Sources of Errors

Definition
How can we define an ERRORin computation?
In its simplest form, it is just the difference between the exact
value(answer), XE , say, and the computed(approximated)
value(answer), XA .

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 5 / 44


Sources of Errors

Definition
How can we define an ERRORin computation?
In its simplest form, it is just the difference between the exact
value(answer), XE , say, and the computed(approximated)
value(answer), XA .
Hence, we can write

Error, E = XA XE

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 5 / 44


Sources of Errors

Sources of Errors
What are the possible sources of error in computation?

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 6 / 44


Sources of Errors

Sources of Errors
What are the possible sources of error in computation?
When a computational procedure is involved in solving a
scientific-mathematical problem, errors often will be involved in
the process.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 6 / 44


Sources of Errors

Sources of Errors
What are the possible sources of error in computation?
When a computational procedure is involved in solving a
scientific-mathematical problem, errors often will be involved in
the process.
A rough classification of the kinds of original errors that might
occur is as follows:

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 6 / 44


Sources of error

Kinds of Original Errors


1 Modelling Errors: Mathematical modelling is a process when
mathematical equations are used to represent a physical system.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 7 / 44


Sources of error

Kinds of Original Errors


1 Modelling Errors: Mathematical modelling is a process when
mathematical equations are used to represent a physical system.
This modeling introduces errors and are called modelling errors.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 7 / 44


Sources of error

Kinds of Original Errors


1 Modelling Errors: Mathematical modelling is a process when
mathematical equations are used to represent a physical system.
This modeling introduces errors and are called modelling errors.
2 Blunders and Mistakes: Blunders occur at any stage of the
mathematical modeling process and consists to all other
components of error.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 7 / 44


Sources of error

Kinds of Original Errors


1 Modelling Errors: Mathematical modelling is a process when
mathematical equations are used to represent a physical system.
This modeling introduces errors and are called modelling errors.
2 Blunders and Mistakes: Blunders occur at any stage of the
mathematical modeling process and consists to all other
components of error.
Blunders can be avoided by sound knowledge of fundamental
principles and with taking proper care in approach and design to a
solution. Mistakes are due to the programming errors.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 7 / 44


Sources of error

Sources of Error
3 Machine Representation and Arithmetic Errors: These errors are
inevitable when using floating-point arithmetic when using
computers or calculators. Examples are rounding and chopping
errors.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 8 / 44


Sources of error

Sources of Error
3 Machine Representation and Arithmetic Errors: These errors are
inevitable when using floating-point arithmetic when using
computers or calculators. Examples are rounding and chopping
errors.
4 Mathematical Approximation Errors: This error is also known as a
truncation error or discretisation error. These errors arise when an
approximate formulation is made to a problem that otherwise
cannot be solved exactly.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 8 / 44


Accuracy and Precision

Accuracy and Precision


It is important to differentiate between two key concepts of errors:
Accuracy and Precision.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 9 / 44


Accuracy and Precision

Accuracy and Precision


It is important to differentiate between two key concepts of errors:
Accuracy and Precision.
Accuracy: Accuracy refers to how close a computed or measured
value agrees with the theoretical true value.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 9 / 44


Accuracy and Precision

Accuracy and Precision


It is important to differentiate between two key concepts of errors:
Accuracy and Precision.
Accuracy: Accuracy refers to how close a computed or measured
value agrees with the theoretical true value.
It is the degree of closeness of agreement between a measured
value and a true or accepted value.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 9 / 44


Accuracy and Precision

Accuracy and Precision


It is important to differentiate between two key concepts of errors:
Accuracy and Precision.
Accuracy: Accuracy refers to how close a computed or measured
value agrees with the theoretical true value.
It is the degree of closeness of agreement between a measured
value and a true or accepted value.
Measurement error is the amount of inaccuracy.

Mbigili, L.J Numerical Analysis-Topic Two: ErrorsMarch 28, 2017 9 / 44


Accuracy and Precision

Accuracy and Precision


Precision: Precision refers to how close individual computed or
measured values agree with each other.Is a measure of how
repeated a value is.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 10 / 44
Accuracy and Precision

Accuracy and Precision


Precision: Precision refers to how close individual computed or
measured values agree with each other.Is a measure of how
repeated a value is.
It is the degree of consistency and agreement among independent
measurements of the same quantity; also the reliability or
reproducibility of the result.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 10 / 44
Accuracy and Precision

Accuracy and Precision


Precision: Precision refers to how close individual computed or
measured values agree with each other.Is a measure of how
repeated a value is.
It is the degree of consistency and agreement among independent
measurements of the same quantity; also the reliability or
reproducibility of the result.
The uncertainty estimate associated with a measurement should
account for both the accuracy and precision of the measurement.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 10 / 44
Accuracy and Precision

Accuracy and Precision


Inaccuracy (also known as bias) is the systematic deviation from
the truth.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 11 / 44
Accuracy and Precision

Accuracy and Precision


Inaccuracy (also known as bias) is the systematic deviation from
the truth.
Imprecision (uncertainty) refers to the magnitude of the scatter.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 11 / 44
Accuracy and Precision

Accuracy and Precision


Inaccuracy (also known as bias) is the systematic deviation from
the truth.
Imprecision (uncertainty) refers to the magnitude of the scatter.
To illustrate this point, think of throwing darts at a dart board.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 11 / 44
Accuracy and Precision

Accuracy and Precision


Inaccuracy (also known as bias) is the systematic deviation from
the truth.
Imprecision (uncertainty) refers to the magnitude of the scatter.
To illustrate this point, think of throwing darts at a dart board.
Being accurate is similar to throwing five darts and surrounding
the bulls eye.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 11 / 44
Accuracy and Precision

Accuracy and Precision


Inaccuracy (also known as bias) is the systematic deviation from
the truth.
Imprecision (uncertainty) refers to the magnitude of the scatter.
To illustrate this point, think of throwing darts at a dart board.
Being accurate is similar to throwing five darts and surrounding
the bulls eye.
Precision is similar to throwing five darts and that all strike right
next to each other, but are not necessarily on the bulls eye.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 11 / 44
Accuracy and Precision

Accuracy and Precision

Figure: Concepts of accuracy and precisions

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 12 / 44
Errors in Numerical Computations

Errors in Numerical Computations


In numerical computations, we come across the following types of
errors:
1 Human Errors

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 13 / 44
Errors in Numerical Computations

Errors in Numerical Computations


In numerical computations, we come across the following types of
errors:
1 Human Errors
2 Inherent errors

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 13 / 44
Errors in Numerical Computations

Errors in Numerical Computations


In numerical computations, we come across the following types of
errors:
1 Human Errors
2 Inherent errors
3 Round-off errors

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 13 / 44
Errors in Numerical Computations

Errors in Numerical Computations


In numerical computations, we come across the following types of
errors:
1 Human Errors
2 Inherent errors
3 Round-off errors
4 Truncation errors

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 13 / 44
Human Error

Human Error
A typical human error is Arithmetic Errorand Programming
Error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 14 / 44
Human Error

Human Error
A typical human error is Arithmetic Errorand Programming
Error.
These errors can be very hard to detect unless they give obviously
incorrect solution.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 14 / 44
Human Error

Human Error
A typical human error is Arithmetic Errorand Programming
Error.
These errors can be very hard to detect unless they give obviously
incorrect solution.
In discussing errors, we shall assume that Human errors are not
present.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 14 / 44
Inherent errors

Inherent errors
Inherent errors are the errors that pre-exist in the problem
statement itself before its solution is obtained.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 15 / 44
Inherent errors

Inherent errors
Inherent errors are the errors that pre-exist in the problem
statement itself before its solution is obtained.
Inherent errors exist because the data being approximate or due to
the limitations of the calculations using digital computers.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 15 / 44
Inherent errors

Inherent errors
Inherent errors are the errors that pre-exist in the problem
statement itself before its solution is obtained.
Inherent errors exist because the data being approximate or due to
the limitations of the calculations using digital computers.
Inherent errors cannot be completely eliminated but can be
minimized if we select better data or by employing high precision
computer computations.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 15 / 44
Truncation Errors

Truncation Errors
Truncation error is present when some infinite process is
(prematurely broken off) approximated by a finite process.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 16 / 44
Truncation Errors

Truncation Errors
Truncation error is present when some infinite process is
(prematurely broken off) approximated by a finite process.
Thus, we can say that truncation error results from terminating
after a finite number of terms known as formula truncation error
or simply truncation error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 16 / 44
Truncation Errors

Truncation Errors
Truncation error is present when some infinite process is
(prematurely broken off) approximated by a finite process.
Thus, we can say that truncation error results from terminating
after a finite number of terms known as formula truncation error
or simply truncation error.
The Taylors theorem in studying truncation errors is a good
example and worth be considered.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 16 / 44
Truncation Errors

Theorem (Taylors Theorem)


Suppose f C n [a, b] and f n+1 exists on [a, b]. Let x0 be a number in
[a, b]. For every x in [a, b], there exists a number (x) between xo and x
such that
f (x) = Pn (x) + Rn (x) where (1)
f 00 (x0 ) f n (x0 )
Pn (x) = f (x0 ) + f 0 (x0 )(x x0 ) + (x x0 )2 + . . . + (x x0 )
2! n!
n
X f k (x0 )
= (x x0 )k and
k!
k=0
(2)
x
f n+1 ((x))
Z
1
Rn (x) = (x t)n f n+1 (t)dt = (x x0 )n+1 (3)
n! x0 (n + 1)!

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 17 / 44
Truncation Errors

Truncation Errors
Here, Pn (x) is called the nth Taylor polynomial for f about x0
and Rn (x) is the Truncation error(or Remainder term)
associated with Pn (x).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 18 / 44
Truncation Errors

Truncation Errors
Here, Pn (x) is called the nth Taylor polynomial for f about x0
and Rn (x) is the Truncation error(or Remainder term)
associated with Pn (x).
Since the number (x) in the truncation error Rn (x) depends on
the value of x at which the polynomial Pn (x) is being evaluated, it
is actually a function of the variable x.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 18 / 44
Truncation Errors

Truncation Errors
Here, Pn (x) is called the nth Taylor polynomial for f about x0
and Rn (x) is the Truncation error(or Remainder term)
associated with Pn (x).
Since the number (x) in the truncation error Rn (x) depends on
the value of x at which the polynomial Pn (x) is being evaluated, it
is actually a function of the variable x.
In fact, one of the common problems in numerical methods is to
try to determine a realistic bound for the value of f n+1 ((x)) for
values of x within some specified interval.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 18 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

n (x) , max |f n+1 ((x))| (4)


x0 (x)x

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

n (x) , max |f n+1 ((x))| (4)


x0 (x)x

From (3) and (4), the upper bound on the size of the truncation
error can be written as

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

n (x) , max |f n+1 ((x))| (4)


x0 (x)x

From (3) and (4), the upper bound on the size of the truncation
error can be written as

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors
Truncation Errors
It is possible sometimes to place upper bound on the x of Rn (x)
depending on the nature of function f (x).
If the maximum value of |f n+1 ((x))| over the interval [x0 , x] is
known or can be evaluated, then

n (x) , max |f n+1 ((x))| (4)


x0 (x)x

From (3) and (4), the upper bound on the size of the truncation
error can be written as
|(x x0 )|n+1
|Rn (x)| n (x) (5)
(n + 1)!

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 19 / 44
Truncation Errors

Truncation Errors
If h = x x0 , then the truncation error Rn (x) is said to be of
order O(hn ).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 20 / 44
Truncation Errors

Truncation Errors
If h = x x0 , then the truncation error Rn (x) is said to be of
order O(hn ).
In other words, as h 0, Rn (x) 0 at the same rate as hn .

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 20 / 44
Truncation Errors

Truncation Errors
If h = x x0 , then the truncation error Rn (x) is said to be of
order O(hn ).
In other words, as h 0, Rn (x) 0 at the same rate as hn .
Hence

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 20 / 44
Truncation Errors

Truncation Errors
If h = x x0 , then the truncation error Rn (x) is said to be of
order O(hn ).
In other words, as h 0, Rn (x) 0 at the same rate as hn .
Hence

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 20 / 44
Truncation Errors

Truncation Errors
If h = x x0 , then the truncation error Rn (x) is said to be of
order O(hn ).
In other words, as h 0, Rn (x) 0 at the same rate as hn .
Hence
O(hn ) chn , where |h| << 1 (6)

where c is a non-zero constant.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 20 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.
We have

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.
We have

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.
We have
x2 x3 xn
ex = 1 + x + + + ... + + ... (7)
2! 3! n!
If this formula is used to calculate f = e0.1 we get

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.
We have
x2 x3 xn
ex = 1 + x + + + ... + + ... (7)
2! 3! n!
If this formula is used to calculate f = e0.1 we get

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors: Example 1


Consider the Taylor series expansion for the function f (x) = ex at
x = 0.
We have
x2 x3 xn
ex = 1 + x + + + ... + + ... (7)
2! 3! n!
If this formula is used to calculate f = e0.1 we get

(0.1)2 (0.1)3 (0.1)n


e0.1 = 1 + 0.1 + + + ... + + ... (8)
2! 3! n!

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 21 / 44
Truncation Errors

Truncation Errors:Example 1
Here the questions are, where do we stop the calculations? How
many terms do we include?

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 22 / 44
Truncation Errors

Truncation Errors:Example 1
Here the questions are, where do we stop the calculations? How
many terms do we include?
Theoretically the calculations will never stop. There are always
more terms to add on and if we do stop after a finite number of
terms, we will not get the exact answer.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 22 / 44
Truncation Errors

Truncation Errors: Example 1


For example if we take the first five terms as the approximation we
get

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 23 / 44
Truncation Errors

Truncation Errors: Example 1


For example if we take the first five terms as the approximation we
get

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 23 / 44
Truncation Errors

Truncation Errors: Example 1


For example if we take the first five terms as the approximation we
get

(0.1)2 (0.1)3 (0.1)4


f = e0 .1 1 + 0.1 + + + = f 1.10517 (9)
2! 3! 4!

For this calculation, the truncation error T E(ie the sum of the
terms that have been chopped off) is

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 23 / 44
Truncation Errors

Truncation Errors: Example 1


For example if we take the first five terms as the approximation we
get

(0.1)2 (0.1)3 (0.1)4


f = e0 .1 1 + 0.1 + + + = f 1.10517 (9)
2! 3! 4!

For this calculation, the truncation error T E(ie the sum of the
terms that have been chopped off) is

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 23 / 44
Truncation Errors

Truncation Errors: Example 1


For example if we take the first five terms as the approximation we
get

(0.1)2 (0.1)3 (0.1)4


f = e0 .1 1 + 0.1 + + + = f 1.10517 (9)
2! 3! 4!

For this calculation, the truncation error T E(ie the sum of the
terms that have been chopped off) is

(0.1)5 (0.1)6 (0.1)7 (0.1)8


T E = R4 (x) = f f = + ...
5! 6! 7! 8!
(10)
The numerical analyst might try to estimate the size of the
truncation error, that is |T E| = |R4 (x)|.
Mbigili, L.J Numerical Analysis-Topic Two: Errors
March 28, 2017 23 / 44
Truncation Errors

Truncation Errors: Example 1


In this example we can easily get a rough estimate

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 24 / 44
Truncation Errors

Truncation Errors: Example 1


In this example we can easily get a rough estimate

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 24 / 44
Truncation Errors

Truncation Errors: Example 1


In this example we can easily get a rough estimate

(0.1)5 (0.1) (0.1)2 (0.1)3


|R4 (x)|= (1 + + + + . . .)
5! 6 67 678
(0.1)5 (0.1)2 (0.1)3 (0.1)4 (11)
(1 + 0.1 + + + + . . .)
5! 2! 3! 4!
(0.1)5 0.1 0.00001
= e 1.10517 107
5! 120

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 24 / 44
Truncation Errors

Truncation Errors: Example 1


Thus the error in truncating to five terms is approximately 107 at
x = 0.1.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 25 / 44
Truncation Errors

Truncation Errors: Example 1


Thus the error in truncating to five terms is approximately 107 at
x = 0.1.
This truncation error which is an actual error could coincide with
the bound of the accuracy to the approximation computed through

x5
|R4 (x)| max |f n+1 ((x)|
0<(x)<0.1 5!

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 25 / 44
Rounding Errors

Rounding Errors(Round-off Error)


Rounding error is due to the inaccuracies that arise due to a finite
number of digits of precision used to represent numbers.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 26 / 44
Rounding Errors

Rounding Errors(Round-off Error)


Rounding error is due to the inaccuracies that arise due to a finite
number of digits of precision used to represent numbers.
All computers represent numbers, except for integers and some
fractions, with imprecision.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 26 / 44
Rounding Errors

Rounding Errors(Round-off Error)


Rounding error is due to the inaccuracies that arise due to a finite
number of digits of precision used to represent numbers.
All computers represent numbers, except for integers and some
fractions, with imprecision.
Digital computers use floating-point numbers of fixed word length,
and this type of representation will not express the exact or true
values correctly.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 26 / 44
Rounding Errors

Rounding Errors(Round-off Error)


Rounding error is due to the inaccuracies that arise due to a finite
number of digits of precision used to represent numbers.
All computers represent numbers, except for integers and some
fractions, with imprecision.
Digital computers use floating-point numbers of fixed word length,
and this type of representation will not express the exact or true
values correctly.
Therefore, errors introduced by the omission of significant figures
due to computer imperfection is called the the round-off error

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 26 / 44
Rounding Errors

Rounding Errors
For further clarification of the idea of rounding error, lets consider
the calculation of f that was considered in the example above.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 27 / 44
Rounding Errors

Rounding Errors
For further clarification of the idea of rounding error, lets consider
the calculation of f that was considered in the example above.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 27 / 44
Rounding Errors

Rounding Errors
For further clarification of the idea of rounding error, lets consider
the calculation of f that was considered in the example above.

(0.1)2 (0.1)3 (0.1)4


f= 1 + 0.1 + + + .
2! 3! 4!
= 1 + 0.1 + 0.005 + 0.000166 + 0.000004166 (12)

= 1.105170833

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 27 / 44
Rounding Errors

Rounding Errors
The exact answer to the truncated problem, f is an infinite string
of digits and, as such, is not very useful.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 28 / 44
Rounding Errors

Rounding Errors
The exact answer to the truncated problem, f is an infinite string
of digits and, as such, is not very useful.
Since we know that it is in the seventh decimal place, we could
round it to six or seven decimal places.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 28 / 44
Rounding Errors

Rounding Errors
The exact answer to the truncated problem, f is an infinite string
of digits and, as such, is not very useful.
Since we know that it is in the seventh decimal place, we could
round it to six or seven decimal places.
For example, rounding to six decimal places gives
f ' 1.105171 = f where the usual rounding process has been
adopted.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 28 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 29 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 29 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.
Using the usual rounding process(and rounding to six decimal
places) the rounding error is always bounded by 12 10k .

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 29 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.
Using the usual rounding process(and rounding to six decimal
places) the rounding error is always bounded by 12 10k .
Thus, in computing the answer e0.1 f = 1.105171, two errors are
present.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 29 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.
Using the usual rounding process(and rounding to six decimal
places) the rounding error is always bounded by 12 10k .
Thus, in computing the answer e0.1 f = 1.105171, two errors are
present.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 29 / 44
Rounding Errors

Rounding Errors
The difference between f and f, f f = 0.000000166 = RE is the
rounding error.
Using the usual rounding process(and rounding to six decimal
places) the rounding error is always bounded by 12 10k .
Thus, in computing the answer e0.1 f = 1.105171, two errors are
present.

ERROR(E)= f f = (f f) + (f f )
= RE + T E and the absolute error is
1 1
|E| |RE| + |T E| 106 + 107 106
2 2

Note that in this case the actual error is dominated by Rounding.


Mbigili, L.J Numerical Analysis-Topic Two: Errors
March 28, 2017 29 / 44
Absolute and Relative Errors

Definition
In numerical analysis, we are usually interested in the magnitude
or absolute value of the error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 30 / 44
Absolute and Relative Errors

Definition
In numerical analysis, we are usually interested in the magnitude
or absolute value of the error.
So we define the absolute error as the difference between the
approximated measurement or computed value (XA ) and the exact
measurement or exact answer (XE ).

Absolute Error, Ea = |XA XE | (13)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 30 / 44
Absolute and Relative Errors

Relative Error and upper bound


In practical calculations, it is important to obtain an upper bound
on the error.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 31 / 44
Absolute and Relative Errors

Relative Error and upper bound


In practical calculations, it is important to obtain an upper bound
on the error.
That is, a number is found such

Ea = |XA XE | <

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 31 / 44
Absolute and Relative Errors

Relative Error and upper bound


In practical calculations, it is important to obtain an upper bound
on the error.
That is, a number is found such

Ea = |XA XE | <

Clearly we would like to be small.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 31 / 44
Absolute and Relative Errors

Relative Error and upper bound


In practical calculations, it is important to obtain an upper bound
on the error.
That is, a number is found such

Ea = |XA XE | <

Clearly we would like to be small.


In practice, we are often more interested in so called Relative
Errorrather than absolute error and we define
|XA XE |
Relative Error, Er = (14)
|XE |

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 31 / 44
Absolute and Relative Errors

Relative Error and upper bound


In practical calculations, it is important to obtain an upper bound
on the error.
That is, a number is found such

Ea = |XA XE | <

Clearly we would like to be small.


In practice, we are often more interested in so called Relative
Errorrather than absolute error and we define
|XA XE |
Relative Error, Er = (14)
|XE |

This is often expressed as a percentage.


Mbigili, L.J Numerical Analysis-Topic Two: Errors
March 28, 2017 31 / 44
Absolute and Relative Errors

Relative Error
Thus an error of 105 may be a good or bad relative
errordepending on the answer.

Answer = 1000, E = 105 very good


Answer = 1, E = 105 good
Answer = 105 , E = 105 very bad

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 32 / 44
Significant digits

Significant digits
Significant digits: The concept of a significant figure, or digit,
has been developed to formally define the reliability of a numerical
value.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 33 / 44
Significant digits

Significant digits
Significant digits: The concept of a significant figure, or digit,
has been developed to formally define the reliability of a numerical
value.
The significant digits of a number are those that can be used with
confidence.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 33 / 44
Significant digits

Significant digits
Significant digits: The concept of a significant figure, or digit,
has been developed to formally define the reliability of a numerical
value.
The significant digits of a number are those that can be used with
confidence.
If XE is the exact or true value and XA is an approximation to
XE , then XA is said to approximate XE to t significant digits if t
is the largest non-negative integer for which
XA XE
< 5 10t (15)
XE

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 33 / 44
Significant digits

Chopping and Rounding errors


Example 1: Let the exact or true value XE = 20/3 and the
approximate value XA = 6.666. Determine the absolute error,
relative error and the number of significant digits.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 34 / 44
Significant digits

Chopping and Rounding errors


Example 1: Let the exact or true value XE = 20/3 and the
approximate value XA = 6.666. Determine the absolute error,
relative error and the number of significant digits.
Example 2:If XE = e (base of the natural algorithm =
2.7182818) is approximated by XA = 2.71828, what is the
significant number of digits to which XA approximates XE ?

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 34 / 44
Significant digits

Chopping and Rounding errors


Example 1: Let the exact or true value XE = 20/3 and the
approximate value XA = 6.666. Determine the absolute error,
relative error and the number of significant digits.
Example 2:If XE = e (base of the natural algorithm =
2.7182818) is approximated by XA = 2.71828, what is the
significant number of digits to which XA approximates XE ?
Example 3: Given the number is approximated using n = 5
decimal digits.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 34 / 44
Significant digits

Chopping and Rounding errors


Example 1: Let the exact or true value XE = 20/3 and the
approximate value XA = 6.666. Determine the absolute error,
relative error and the number of significant digits.
Example 2:If XE = e (base of the natural algorithm =
2.7182818) is approximated by XA = 2.71828, what is the
significant number of digits to which XA approximates XE ?
Example 3: Given the number is approximated using n = 5
decimal digits.
(a) Determine the relative error due to chopping and express it as a per
cent.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 34 / 44
Significant digits

Chopping and Rounding errors


Example 1: Let the exact or true value XE = 20/3 and the
approximate value XA = 6.666. Determine the absolute error,
relative error and the number of significant digits.
Example 2:If XE = e (base of the natural algorithm =
2.7182818) is approximated by XA = 2.71828, what is the
significant number of digits to which XA approximates XE ?
Example 3: Given the number is approximated using n = 5
decimal digits.
(a) Determine the relative error due to chopping and express it as a per
cent.
(b) Determine the relative error due to rounding and express it as a per
cent.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 34 / 44
Significant digits

Chopping and Rounding errors


Example 4: Use Taylor series expansions (zero through fourth
order) to predict f (2) for f (x) = ln(x) with a base point at x = 1.
Determine the true percentage relative error for each
approximation.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 35 / 44
Significant digits

Chopping and Rounding errors


Example 4: Use Taylor series expansions (zero through fourth
order) to predict f (2) for f (x) = ln(x) with a base point at x = 1.
Determine the true percentage relative error for each
approximation.
Example 5: If the number = 4 arctan(1) is approximated using
5 decimal digits, find the percentage relative error due to, (a)
chopping (b) rounding.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 35 / 44
Significant digits

Chopping and Rounding errors


Example 4: Use Taylor series expansions (zero through fourth
order) to predict f (2) for f (x) = ln(x) with a base point at x = 1.
Determine the true percentage relative error for each
approximation.
Example 5: If the number = 4 arctan(1) is approximated using
5 decimal digits, find the percentage relative error due to, (a)
chopping (b) rounding.
Example 6: Given two numbers a = 8.8909 103 and
b = 8.887 103 . Calculate the difference between the two numbers
(a b) using decimal floating point approximation (scientific
notation) with three significant digits in the mantissa by (a)
chopping (b) rounding.
Mbigili, L.J Numerical Analysis-Topic Two: Errors
March 28, 2017 35 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.
(a) expand f (x) about x = 0 using Taylor series

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.
(a) expand f (x) about x = 0 using Taylor series
(b) truncate the series to n = 6 terms

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.
(a) expand f (x) about x = 0 using Taylor series
(b) truncate the series to n = 6 terms
(c) find the relative error at x = 4 due to truncation in (b).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.
(a) expand f (x) about x = 0 using Taylor series
(b) truncate the series to n = 6 terms
(c) find the relative error at x = 4 due to truncation in (b).
(d) determine the upper bound on the magnitude of the relative error
at x = 4 and express it as a percent.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Significant digits

Chopping and Rounding errors


Example 7: Given the trigonometric function f (x) = sin x.
(a) expand f (x) about x = 0 using Taylor series
(b) truncate the series to n = 6 terms
(c) find the relative error at x = 4 due to truncation in (b).
(d) determine the upper bound on the magnitude of the relative error
at x = 4 and express it as a percent.

Example 8: Determine (a) the second and (b) the third Taylor
polynomials for f (x) = cos x about x = 0, and use these
polynomials to approximate cos(0.01). (c) Use the third Taylor
R 0.1
polynomial and its remainder term to approximate 0 cos xdx

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 36 / 44
Function Approximation

Function Approximation
In this section, we derive a general formula for the error
committed in using a certain formula or a function relation.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 37 / 44
Function Approximation

Function Approximation
In this section, we derive a general formula for the error
committed in using a certain formula or a function relation.
Consider the function F = f (x1 , x2 , . . . , xn ) be a function of
several variables xi (i = 1, 2, 3, . . . , n).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 37 / 44
Function Approximation

Function Approximation
In this section, we derive a general formula for the error
committed in using a certain formula or a function relation.
Consider the function F = f (x1 , x2 , . . . , xn ) be a function of
several variables xi (i = 1, 2, 3, . . . , n).
Let the error in each variable xi be xi . Then the error F in F
is given by

F + F = f (x1 + x1 , x2 + x2 , . . . , xn + xn ) (16)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 37 / 44
Function Approximation

Function Approximation
Expanding the right hand side by Taylors series, we obtain
n
X f
F + F = f (x1 , x2 , . . . , xn ) + xi
xi
i=1

+ terms involving higher powers of xi .


n
X f
= f (x1 , x2 , . . . , xn ) + xi + O(x2i )
xi
i=1

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 38 / 44
Function Approximation

Function Approximation
Assuming that the errors in xi are small enough so that x
xi << 1,
i

and that the squares and other higher powers of xi can be


neglected, then the above relation yields
n
X f
F xi
xi
i=1 (17)
f f f
= x1 + x2 + . . . + xn
x1 x2 xn

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 39 / 44
Function Approximation

Function Approximation
We observe that this formula has the same form as that for the
total differential of F .

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 40 / 44
Function Approximation

Function Approximation
We observe that this formula has the same form as that for the
total differential of F .
The formula for the relative error follows immediately
F f x1 f x2 f xn
Er = = + + ... + (18)
F x1 f x2 f xn f

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 40 / 44
Function Approximation

Function Approximation
We observe that this formula has the same form as that for the
total differential of F .
The formula for the relative error follows immediately
F f x1 f x2 f xn
Er = = + + ... + (18)
F x1 f x2 f xn f

The following example illustrates the use of this formula

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 40 / 44
Function Approximation

Function Approximation
We observe that this formula has the same form as that for the
total differential of F .
The formula for the relative error follows immediately
F f x1 f x2 f xn
Er = = + + ... + (18)
F x1 f x2 f xn f

The following example illustrates the use of this formula


2
Example 9: Given the function F = f (x, y, z) = 5xy
z3
. Let
x = y = z = 0.001, and x = y = z = 1. Determine the
relative maximum error (Er )max .(Answer (Er )max = 0.006.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 40 / 44
Stability and Condition

Stability and Condition


A numerical computation is said to be numerically unstable if
the uncertainty of the input values is grossly magnified by the
numerical method employed.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 41 / 44
Stability and Condition

Stability and Condition


A numerical computation is said to be numerically unstable if
the uncertainty of the input values is grossly magnified by the
numerical method employed.
Consider the first-order Taylors series of the function given by

f (x) = f (x0 ) + f 0 (x0 )(x x0 ) (19)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 41 / 44
Stability and Condition

Stability and Condition


A numerical computation is said to be numerically unstable if
the uncertainty of the input values is grossly magnified by the
numerical method employed.
Consider the first-order Taylors series of the function given by

f (x) = f (x0 ) + f 0 (x0 )(x x0 ) (19)

The relative error of f (x) then becomes

f (x) f (x0 ) f 0 (x0 )(x x0 )


Er = = (20)
f (x) f (x0 )

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 41 / 44
Stability and Condition

Stability and Condition


The relative error of x becomes
x x0
(21)
x0

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 42 / 44
Stability and Condition

Stability and Condition


The relative error of x becomes
x x0
(21)
x0

A condition number is often defined as the ratio of the relative


errors given by Equations (20) and (21) as

x0 f 0 (x0 )
Condition number = (22)
f (x0 )

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 42 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).
1 Condition number= 1 (functions relative error = relative error in x)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).
1 Condition number= 1 (functions relative error = relative error in x)
2 Condition number> 1 (relative error is amplified)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).
1 Condition number= 1 (functions relative error = relative error in x)
2 Condition number> 1 (relative error is amplified)
3 Condition number< 1 (relative error is attenuated) (1.41)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).
1 Condition number= 1 (functions relative error = relative error in x)
2 Condition number> 1 (relative error is amplified)
3 Condition number< 1 (relative error is attenuated) (1.41)
4 Condition number > very large number (the function is
ill-conditioned)

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Stability and Condition

Stability and Condition


The condition number given by Equation (22) indicates the extent
to which an uncertainty in x is magnified by f (x).
1 Condition number= 1 (functions relative error = relative error in x)
2 Condition number> 1 (relative error is amplified)
3 Condition number< 1 (relative error is attenuated) (1.41)
4 Condition number > very large number (the function is
ill-conditioned)

Example 10: Compute and interpret the condition number for


(a) f (x) = sin x for x0 = 0.51 and (b) f (x) = tan x for x0 = 1.7.

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 43 / 44
Questions?

Mbigili, L.J Numerical Analysis-Topic Two: Errors


March 28, 2017 44 / 44

S-ar putea să vă placă și