Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example 1 (P46) What’s the binary form of x=2/3

Similar presentations


Presentation on theme: "Example 1 (P46) What’s the binary form of x=2/3"— Presentation transcript:

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)?

2

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)

4

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(xy) = [xy] (1+) where ||; here,  can be taken to be the unit roundoff error for the machine. In Marc-32, =2-24. Q: How to compute xy 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(xy) = fl(fl(x)fl(y)) = (fl(x)fl(y)) (1+3) = [(x(1+1))  (y(1+2))](1+3) = (xy)(1+1+2+12) (1+3)  xy 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 +12)  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

13


Download ppt "Example 1 (P46) What’s the binary form of x=2/3"

Similar presentations


Ads by Google