Professional Documents
Culture Documents
±𝟎. 𝒅𝟏 𝒅𝟐 … 𝒅𝒌 𝜷𝒏 , 𝒅𝟏 ≠ 𝟎 , 𝟎 ≤ 𝒅𝒊 < 𝛽
Mantissa Base Exponent
Approximated numbers
Real numbers are approximated by chopping or
rounding.
Example 1
Approximate the number 𝒑 = 𝟒𝟑. 𝟓𝟔𝟒𝟑𝟖𝟓𝟒, using:
a) 3-digit chopping: 𝑓𝑙(𝑝) = 43.5 = 0.435 ∗ 102
b) 3 digit rounding: 𝑓𝑙 (𝑝) = 43.6 = 0.436 ∗ 102
Example 2
Approximate the number 𝒑 = 𝟓𝟐, 𝟓𝟔𝟒, 𝟑𝟖𝟓, using:
c) 3-digit chopping: 𝑓𝑙(𝑝) = 52,500,000 = 0.525 ∗ 108
d) 3 digit rounding
e) 2 digit chopping
f) 2-digit rounding
1
Error Measuring
Let 𝒑∗ be an approximation to a real number 𝒑. Then
𝒆𝒑 = |𝒑∗ − 𝒑| is called absolute error
|𝒑∗ −𝒑| |𝒑∗ −𝒑|
𝜹𝒑 = |𝒑|
~ | 𝒑∗ | is called relative error
Example 3
Find the absolute error and the relative error:
a) 𝒑∗ = 𝟎. 𝟐 ∗ 𝟏𝟎𝟐 ~𝒑 = 𝟐𝟏
b) 𝒑∗ = 𝟎. 𝟐 ∗ 𝟏𝟎𝟓 ~𝒑 = 𝟐𝟏𝟎𝟎𝟎
c) 𝒑∗ = 𝟎. 𝟐 ∗ 𝟏𝟎−𝟑 ~𝒑 = 𝟎. 𝟎𝟎𝟎𝟐𝟏
Remark
Using absolute error or relative error may be misleading
2
Example 4 Let
𝟒 𝟐
𝒑= +
𝟕 𝟑
Calculate:
a) Exact value of 𝒑.
3
Errors in Scientific Computations
4
Polynomial computation
To evaluate 𝑷𝟒 (𝑥 ) = 𝑎4 𝑥 4 + 𝑎3 𝑥 3 + 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0 at = 𝛼
, the number of operations is reduced when a nested form is
used:
𝑷𝟒 (𝑥 ) = 𝑥(𝑥(𝑥(𝑎4 𝑥 + 𝑎3 ) + 𝑎2 ) + 𝑎1 ) + 𝑎0
Example 2
Consider. 𝒇(𝑥 ) = 𝑥 3 − 6.1𝑥 2 + 3.2𝑥 + 1.5,
𝒈(𝑥 ) = 𝑥(𝑥(𝑥 − 6.1) + 3.2) + 1.5
>
>
>
b) 3-digit rounding
>
5
Computation of Series
Starting with sum of small numbers will reduces the error
Example 3
Use 3-digit chopping arithmetic to compute:
1
a) ∑10
1 𝑛2
= 1.53
1
b) ∑10
1 (11−𝑛)2
= 1.54
Actual value of the sum is 1.541