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)?
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)
The computer with 5 decimal digits stores those results in rounded form as The relative errors are respectively
The computer with 5 decimal digits stores those results in rounded form as The relative errors are respectively
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?
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.
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
Find fl(x(y+z)) for x, y, z A={machine numbers of Marc-32}.
Theorem on Relative Roundoff Error in Adding
Theorem on Relative Roundoff Error in Adding