p1032

p1032 - SECTION 2: AN INTRODUCTION TO FLOATING POINT...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
SECTION 2: AN INTRODUCTION TO FLOATING POINT ARITHMETIC AND RATES OF CONVERGENCE ...................................................................................................................................... 16 Floating Point Arithmetic ...................................................................................................................... 16 Significant Digits: ................................................................................................................................... 20 Big O and little o notation: ..................................................................................................................... 23 Rates of Convergence ............................................................................................................................. 25
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EE103 Lecture Notes, Fall 2007, Prof S. Jacobsen Section 2 16 SECTION 2: AN INTRODUCTION TO FLOATING POINT ARITHMETIC AND RATES OF CONVERGENCE Consider the number 12. Of course, we can think of the number as 10 10 12 1 10 2 10 (12) Δ =⋅ +⋅ = Or, consider the number 12.625. We can think of this number as 1 2 3 12.625 1 10 2 10 6 10 2 10 6 10 −− =⋅ +⋅ +⋅ +⋅ 02 10 10 (12.625) 10 (.12625) 10 Δ =⋅ = On the other hand, we can also think of the number 12 as 32 1 0 0 2 12 1 2 1 2 0 2 0 2 (1100) 2 =⋅ +⋅ +⋅ +⋅ = Similarly, we can think of 12.625 as 1 2 3 12.625 1 2 1 2 0 2 0 2 1 2 0 2 1 2 =⋅ +⋅ +⋅ +⋅ +⋅ +⋅ +⋅ 04 22 (1100.101) 2 (.1100101) 2 Or, we can think of 12.625 as 1 0 2 88 12.625 1 8 4 8 5 8 (14.5) 8 (.145) 8 =⋅ +⋅ +⋅ = ⋅ = Floating Point Arithmetic Definition : an n digit floating point number, in base β , has the form 123 (. ) e n ddd d ± ⋅⋅⋅ where 0,1,2,. .., 1 i d =− and is an integer. Unless the number in question is zero, we always write the number so that 1 0 d (i.e., we say the number is "normalized"). The term (. ) n d is called the mantissa; e , the exponent, is an integer. The number n is, of course, finite and is often called the "precision". The size of n depends upon the word length of the computer in question and, of course, this value varies considerably. The exponent, e , is an integer and is limited to a range, denoted by min max ee e For instance, the largest number that can be represented on a ( , ) n machine is
Background image of page 2
EE103 Lecture Notes, Fall 2007, Prof S. Jacobsen Section 2 17 max max (.( 1)( 1) ( 1)) (1 ) ee n β βββ − ⋅⋅⋅ = What is the smallest positive, normalized, number that can be represented? The representation of decimal fractions, using a ( , ) n machine, is the source of "round- off" error. Ex. ( 10, 2) n == L e t 2/3 x = . Then, using "rounding", the floating point representation of 2/3 is 0 10 () ( . 6 7 ) 1 0 fl x = and using another method, called "chopping", we have 0 10 ( ) (.66) 10 fl x = or, for 838 x =− , we have 3 10 () ( . 8 4 0 fl x = −⋅ and 3 10 ( . 8 3 0 fl x = respectively. Definition: The value, using a (,) n machine, |( ) | f lx x is called the round-off error . For 0 x , the value || f x x is called the relative error (when the relative error is multiplied by 100, we have the percentage error ). Ex: Let 5 10 T x = denote the true value of x . Let 4 ()1 0 T fl x = . Then 5 |() |9 1 0 TT fl x x −= but 5 5 1 0 9.0 1 0 T fl x x x a percentage error of 900%.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EE103 Lecture Notes, Fall 2007, Prof S. Jacobsen Section 2 18 We may also write ( ) f lx as ( ) (1 ) x fl x x δ = + and, in this notation, we see that |( ) | || x f x x = That is, | | x is the relative error ( 0 x ). Ex: Let's assume a ( 2, ) n β = machine. Let * 1 2 2, 1 e x ff = ⋅≤ < denote an actual machine number. 1/ 2 f holds since we're assuming a normalized machine number and 2 = . By adding a "1" to the least significant place (see the end of this Section for the general case) of the floating point mantissa, the difference between * x and the next floating point number ** yx = is given by 222 ne n e −+ Δ =⋅ =
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

p1032 - SECTION 2: AN INTRODUCTION TO FLOATING POINT...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online