EE103 Section 2

EE103 Section 2 - EE103 Lecture Notes, Winter 2009, Prof S....

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

View Full Document Right Arrow Icon
EE103 Lecture Notes, Winter 2009, Prof S. Jacobsen Section 2 SECTION 2: AN INTRODUCTION TO FLOATING POINT ARITHMETIC AND RATES OF CONVERGENCE ...................................................................................................................................... 16 Floating Point Arithmetic ...................................................................................................................... 16 A Bound on the Relative Error .......................................................................................................... 18 Significant Digits: ............................................................................................................................... 21 Sequences, Big “O”, Little “o”, Rates of Convergence ........................................................................ 22 Big O and little o notation: ................................................................................................................. 23 Rates of Convergence ......................................................................................................................... 25 Geometric Sums ...................................................................................................................................... 29 Back to Floating Point Arithmetic ........................................................................................................ 29
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, Winter 2009, 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 ± ⋅⋅⋅ 1 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 1 Storage of floating point numbers on a real computer is, of course, slightly different.
Background image of page 2
EE103 Lecture Notes, Winter 2009, Prof S. Jacobsen Section 2 17 For instance, the largest number that can be represented on a ( , ) n β machine is 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
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, Winter 2009, Prof S. Jacobsen Section 2 18 a percentage error of 900%.
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

EE103 Section 2 - EE103 Lecture Notes, Winter 2009, Prof S....

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