Download presentation
Presentation is loading. Please wait.
Published byTapani Härkönen Modified over 5 years ago
1
Example 1 (P46) What’s the binary form of x=2/3
Example 1 (P46) What’s the binary form of x=2/3? What are two nearby machine numbers x- and x+ in the Marc-32? Which one is taken to be fl(x)? What are the absolute roundoff error and relative roundoff error in representing x by fl(x)?
3
Stored as machine numbers fl(a),fl(b),… Rounded off (舍入)
Input numbers a,b,c,… Normalized (标准化) Stored as machine numbers fl(a),fl(b),… Rounded off (舍入) Do one arithmetic operation/calculation Obtain a number (result) e.g. fl(a)fl(b)
5
The computer with 5 decimal digits stores those results in rounded form as
The relative errors are respectively
6
The computer with 5 decimal digits stores those results in rounded form as
The relative errors are respectively
7
Denote one of the four basic arithmetic operations: ,
Assume x,y are machine numbers, then there is some constant s.t. fl(xy) = [xy] (1+) where ||; here, can be taken to be the unit roundoff error for the machine. In Marc-32, =2-24. Q: How to compute xy if x,y are not machine numbers?
8
If x,y are not machine numbers, then
there is still some constant s.t. fl(x) = x (1+1) fl(y) = y (1+2) fl(xy) = fl(fl(x)fl(y)) = (fl(x)fl(y)) (1+3) = [(x(1+1)) (y(1+2))](1+3) = (xy)(1+1+2+12) (1+3) xy where |1|,|2|,|3|; still, can be taken to be the unit roundoff error for the machine.
9
Q: How about compand arithmetic operations?
Assume x,y,z A={machine numbers of Marc-32}. fl(x(y+z)) = = [x fl(y+z)] (1+1) |1| 2-24 = [x (y+z) (1+2)] (1+1) |2| 2-24 = x (y+z) (1+2+1 +12) x (y+z) (1+2+1) = x (y+z) (1+3) |3| ? Here 3=2+1
10
Find fl(x(y+z)) for x, y, z A={machine numbers of Marc-32}.
11
Theorem on Relative Roundoff Error in Adding
12
Theorem on Relative Roundoff Error in Adding
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.