Professional Documents
Culture Documents
Chap 2 Sec 2
Chap 2 Sec 2
Chap 2 Sec 2
––Errors
School of Mathematical Sciences
Teaching Group
Textbook:
Ilse C. F. Ipsen, Numerical Matrix Analysis: Linear Systems and Least Squares. SIAM,
2009.
Reference books:
▸ Fuzhen Zhang. Matrix Theory-Basic Results and Techniques, Second Edition.
Springer, 2011.
▸ Roger A. Horn and Charles A. Johnson: Matrix Analysis. Cambridge University
Press, 1985.
▸ Gene H. Golub and Charles F. Van Loan: Matrix Computations, Third Edition.
Johns Hopkins Press, 1996.
▸ Nicholas J. Higham. Accuracy and Stability of Numerical Algorithms, Second
Edition. SIAM, 2002.
▸ Y. Saad. Iterative Methods for Sparse Linear Systems, Second Edition. SIAM,
Philadelphia, 2003.
Matrix Theory Errors
Maintained by Yan-Fei Jing
Absolute and Relative Errors
Outline
Conditioning of Subtraction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Example
Example
The bank makes a mistake and subtracts 20 dollars from every account.
Example
The bank makes a mistake and subtracts 20 dollars from every account.
Matrix Theory Errors - 4/18
Absolute and Relative Errors
Example
Example
Example analysis
Example analysis
Example analysis
Example analysis
Example analysis
Compare the error to the balance in the account!!!
▸ For Someone:
y −̃y
= 2,
y
showing that the error is twice as large as Someone’s original
balance.
▸ For Bill Gatez:
g −̃g
= 2 ⋅ 10−10 ,
g
so that the error is only a tiny fraction of his balance.
⇒ It is clear that the bank.s error is much more serious for Someone
than it is for Bill Gatez.
▸ A difference like y − ̃
y measures an absolute error;
Example analysis
Compare the error to the balance in the account!!!
▸ For Someone:
y −̃y
= 2,
y
showing that the error is twice as large as Someone’s original
balance.
▸ For Bill Gatez:
g −̃g
= 2 ⋅ 10−10 ,
g
so that the error is only a tiny fraction of his balance.
⇒ It is clear that the bank.s error is much more serious for Someone
than it is for Bill Gatez.
▸ A difference like y − ̃
y measures an absolute error;
y −̃y y −̃y
▸ A ratio y
or ̃
y
measure a relative error.
Definition
Definition
▸ If the scalar ̃
x is an approximation to the scalar x , then we call
x∣
∣x − ̃
an absolute error.
Definition
▸ If the scalar ̃
x is an approximation to the scalar x , then we call
x∣
∣x − ̃
an absolute error.
▸ If x ≠ 0, then we call
∣x − ̃x∣
∣x ∣
is a relative error.
Definition
▸ If the scalar ̃
x is an approximation to the scalar x , then we call
x∣
∣x − ̃
an absolute error.
▸ If x ≠ 0, then we call
∣x − ̃x∣
∣x ∣
is a relative error.
▸ If ̃
x ≠ 0, then
x∣
∣x − ̃
x∣
∣̃
is also a relative error.
Significant digits
Significant digits
Significant digits
Significant digits
As a rule of thumb, if
≤ 5 ⋅ 10−d ,
∣x − ̃x∣
∣x ∣
then we say that the numbers x and ̃
x agree to
d decimal digits.
Matrix Theory Errors - 8/18
Absolute and Relative Errors
Significant digits
As a rule of thumb, if
≤ 5 ⋅ 10−d ,
∣x − ̃x∣
∣x ∣
then we say that the numbers x and ̃
x agree to
d decimal digits.
Matrix Theory Errors - 8/18
Absolute and Relative Errors
Significant digits
▸ If x = 1 and ̃
x = 1.003,
then
= 3⋅10−3 ≤ 5⋅10−3 ,
∣x − ̃x∣
∣x ∣
so that x and ̃
x agree
to three decimal digits.
As a rule of thumb, if
≤ 5 ⋅ 10−d ,
∣x − ̃x∣
∣x ∣
then we say that the numbers x and ̃
x agree to
d decimal digits.
Matrix Theory Errors - 8/18
Absolute and Relative Errors
Significant digits
▸ If x = 1 and ̃
x = 1.003,
then
= 3⋅10−3 ≤ 5⋅10−3 ,
∣x − ̃x∣
∣x ∣
so that x and ̃
x agree
to three decimal digits.
A relative error can give information about how ▸ The number x = 1 and
x = 0.997 also agree to
̃
many digits two numbers have in common.
three decimal digits
because
As a rule of thumb, if
= 3⋅10−3 ≤ 5⋅10−3 .
∣x − ̃x∣
≤ 5 ⋅ 10−d ,
∣x − ̃x∣
∣x ∣
∣x ∣
then we say that the numbers x and ̃
x agree to
d decimal digits.
Matrix Theory Errors - 8/18
Floating Point Arithmetic
Outline
Conditioning of Subtraction
Floating point
An early electromechanical
programmable computer, the Z3,
included floating-point arithmetic
(replica on display at Deutsches
Museum in Munich).
Floating point
An early electromechanical
programmable computer, the Z3,
included floating-point arithmetic
(replica on display at Deutsches
Museum in Munich).
Floating point
▸ A number is, in general,
represented approximately to a
fixed number of significant
digits (the significand) and
scaled using an exponent;
(the base for the scaling is
normally two, ten, or sixteen).
An early electromechanical
programmable computer, the Z3,
included floating-point arithmetic
(replica on display at Deutsches
Museum in Munich).
Floating point
▸ A number is, in general,
represented approximately to a
fixed number of significant
digits (the significand) and
scaled using an exponent;
(the base for the scaling is
normally two, ten, or sixteen).
Floating point
▸ A number is, in general,
represented approximately to a
fixed number of significant
digits (the significand) and
scaled using an exponent;
(the base for the scaling is
normally two, ten, or sixteen).
Insight
x = x (1 + x ), where ∣x ∣ ≤ u,
̂
1
We assume that x lies in the range of normalized floating point numbers,
so that no underflow or overflow occurs.
Matrix Theory Errors - 12/18
Floating Point Arithmetic
Insight
x = x (1 + x ), where ∣x ∣ ≤ u,
̂
u = 2−53 ≈ 10−16 .
1
We assume that x lies in the range of normalized floating point numbers,
so that no underflow or overflow occurs.
Matrix Theory Errors - 12/18
Floating Point Arithmetic
Relative perturbation
If x ≠ 0, then
∣x − ̂x∣
= ∣x ∣ ≤ u.
∣x ∣
Relative perturbation
If x ≠ 0, then
∣x − ̂x∣
= ∣x ∣ ≤ u.
∣x ∣
Relative perturbation
If x ≠ 0, then
∣x − ̂x∣
= ∣x ∣ ≤ u.
∣x ∣
Remarks
Remarks
Remarks
Remarks
Outline
Conditioning of Subtraction
Conditioning of Subtraction
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Catastrophic cancellation
x −̃
̃ y =2
This difference is totally inaccurate — because it is derived from
uncertainties, while all the accurate digits have cancelled out.
Catastrophic cancellation
x −̃
̃ y =2
This difference is totally inaccurate — because it is derived from
uncertainties, while all the accurate digits have cancelled out.
This is an example of “catastrophic cancellation”.
Catastrophic cancellation
x −̃
̃ y =2
This difference is totally inaccurate — because it is derived from
uncertainties, while all the accurate digits have cancelled out.
This is an example of “catastrophic cancellation”.
Catastrophic cancellation
x −̃
̃ y =2
This difference is totally inaccurate — because it is derived from
uncertainties, while all the accurate digits have cancelled out.
This is an example of “catastrophic cancellation”.
Catastrophic cancellation
x −̃
̃ y =2
This difference is totally inaccurate — because it is derived from
uncertainties, while all the accurate digits have cancelled out.
This is an example of “catastrophic cancellation”.
QUESTIONS ?