Sei sulla pagina 1di 3

CHAPTER 3: Approximations and RoundRound-Off Errors

3.4 RoundRound-Off Error


1. Chopping or rounding
EX 1) ( = 3.14159265358
Store in a base-10 system carrying 7 significant digits
- With chopping ( = 3.141592
45 = |( 3.141592| 100% 0.000065%
- With rounding ( = 3.141593
45 = |( 3.141593| 100% 0.000035%
2. Subtractive Cancellation
EX 2) consider => ? + A> + B = 0
A A ? 4=B
2=
When A? 4=B , > 0
Correction
2B
>=
A A ? 4=B
EX 3) 2> ? + 40> 1 = 0
40 40? + 8
>=
4
>F G) = no problem
> ? G+) = problem
40 + 40

=0
4
2
>? =
40 + 40? + 8
3. Smearing
Consider inner product
>H = [>F , >? , >J , >K ]
MH = [MF , M? , MJ , MK ]
>=

>H MH = N >O MO
OPF

Correction: use number smaller to largest

Page

December 11, 2014

December 11, 2014

CHAPTER 4: Truncation Errors and the Taylor Series

4.1 Taylor series


o Taylors Thm: If SG>) has continuous GT + 1) derivatives on an interval containing a and x
Then
S UU G=)G> =)? S UU G=)G> =)J
S K G=)G> =)K
SG>) = SG=) + S U G=)G> =) +
+
+ +
+ YK
2!
3!
T!
Where
S GKZF) G[)
Gk) is between a and x
YK =
G> + =)KZF = Remainder
GT + 1)!
Suppose we know SG>) and S GKZF) G[) at > = >O
Suppose >OZF = >O +

>O

By Taylors Thm:

>OZF

SG>OZF ) = SG>O ) + S U G>O ) +

S UU G>O )? S UU G>O )J
S K G>O )K
+
+ +
+ YK
3!
2!
T!

Where
YK is proportional to G>OZF >O )KZF = KZF
`. a. YK = bGKZF )
More on bGK )
- If YK = bG) halving will halve YK
- If YK = bG? ) halving will cut YK to 1d4 of the original value

Different order od approximation


0 order: SG>OZF ) SG>O )
e5
1 order: SG>OZF ) = SG>O ) + S U G>O )

2fg order: SG>OZF ) = SG>O ) + S U G>O ) +

S UU G>O )?
2!

+.
.
.
+
S UU G>O )?
S K G>O )K
nhi order: SG>OZF ) = SG>O ) + S U G>O ) +
+ +
2!
T!

EX 1) use zero through 4th Taylor series expansion to predict SG2.5) for SG>) = lnG>) using a base
point at > = 1. Compute the true percent relative error k5 .
SOL: SG>) = lnG>)
S U G>) =

1
= > mF
>

S UU G>) = > m?
S UUU G>) = 2> mJ

h=step size where = >OZF >O

Page

n G>)

= 6>

mn

December 11, 2014

at: > = 1
SG1) = 0
SG1) = 1
SG1) = 1
SG1) = 2
S n G1) = 6
= >OZF >O = 2.5 1 = 1.5
SG2.5) = lnG2.5) = 0.91629
Approximation
0 order: SG2.5) SG1) = 0
ture value approximation
0.91629 0
k5 = o
o 100% = o
o 100% = 100%
true value
0.91629

Page

1e5 order: SG2.5) = SG1) + S U G1)G1.5) = 0 + 1G1.5) = 1.5


0.91629 1.5
k5 = o
o 100% = 63.7%
0.91629
S UU G1)?
2fg order: SG2.5) = SG1) + S U G1)G1.5) +
= 0 + G1)1.5 + G1.125) = 0.375
2!
0.91629 0.375
k5 = o
o 100% = 59.07%
0.91629
S UU G1)G1.5)? S J G1)G1.5)J
3qr order: SG2.5) = SG1) + S U G1)G1.5) +
+
= 1.5
2!
3!
0.91629 1.5
k5 = o
o 100% = 63.7%
0.91629
S UU G1)G1.5)? S J G1)G1.5)J S n G1)G1.5)n
4hi order: SG2.5) = SG1) + S U G1)G1.5) +
+
+
= 0.23428
2!
3!
4!
0.91629 0.23428
k5 = o
o 100% = 74.42%
0.91629

Potrebbero piacerti anche