Chapter 23
Chapter 23
True error
• For numerical methods, the true value will be known only when
we deal with functions that can be solved analytically (simple
systems). In real world applications, we usually not know the
answer a priori. Then
Ea = Present Approximation − Previous Approximation
x x 2 x3 xn
e = 1+ x + + + ⋅⋅⋅⋅ +
2 3! n!
n =1 e 0.5 = 1 ε =?
1.5 − 1
n=2 e 0.5
= 1 + 0 .5 = 1 .5 ε= = 0.333
1.5
ε s = 0.00001 or 0.001%
Source of Error
(1) Round-off error
Error created due to approximate representation of numbers
Ex) 1/3~0.333:
round-off error=1/3-0.333=0.00033333
5 3 8 0 0 0 0 0 0 ???
0 0 0 0 8 5 3 8
Exponent mantissa
Sign of
number
Sign of exponent
0 0 0 0 8 5 3 8
Exponent mantissa
Sign of
number
Sign of exponent
절대값이 가장 큰 수 00999999=9.99x10999
절대값이 가장 작은 수 01999100=1.00x10-999
IEEE-754 Standard for Single Precision
Base-2 to Base-10
• Binary numbers: Base-2 (0-1), radix point
Ex) (11.1875)10=(?.?)2
(11.)10=(?.)2
Quotient Remainder
11/2 5 1=a0
5/2 2 1=a1
2/2 1 0=a2
1/2 0 1=a3
(11)10=(a3a2a1a0)2
=(1011)2
• (.1875)10=(.?)2
• (.1875)10=(.a-1a-2a-3a-4)2
=(.0011)2
Thus, (11.1875)10=(1011.0011)2
Floating point representation
Exponent mantissa
Sign of
number
Sign of exponent
Ex) (-13.9)10 floating point representation?
(13)10=(1101)2
(0.9)10=(0.11100)2
(-13.9)10=(-1101.11100)2
=(-1.10111100)2×23
~(-1.101)2×2011
1 0 0 1 1 1 0 1
Sign of exponent
Ex) (-13.9)10 floating point representation?
Check!
-(1.101)2×23= -(1×20+1×2-1+0×2-2+1×2-3)×23
=-(1.625)10×23
=-(13)10
Round-off error=(-13.9)~(-13)=0.9
1 0 0 1 1 1 0 1
Sign of exponent
0/1 0 1 1 1 1 1 1
(1.11)2×2111= (1.75)10×27
=(224)10
Overflow: Any number larger than the largest number that
can be expressed on a computer will result in an overflow.
0/1 1 1 1 1 0 0 0
(1.00)2×2-111= (1.00)10×2-7
=(0.007813)10
Underflow: Any positive number smaller than the smallest
number that can be represented on a computer will result
an underflow.
Floating point representation
Exponent mantissa
Sign of
number Min=0 (0000)
Max=15 (1111)
15/2=7.5
0 to 15 (biased)
-7 to 8 (unbiased)
Ex)
1 1 0 1
Exponent ?
(11)2 = 3 → 3 + 7 = 10 = (1010) 2
1 1 0 1 0 1 0 1
IEEE-754 Standard for Single Precision
(11111111)=255
Sign of 255/2=127.5
Number, s
value = (−1) s × (1.m )2 × 2e −127