CSC_349_HANDOUT#3 - COMPUTER SCIENCE 349A Handout Number 3...

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

View Full Document Right Arrow Icon
1 COMPUTER SCIENCE 349A Handout Number 3 Two methods of representing a real number p in floating-point: rounding and chopping . Example Let 3 / 2 and 4 , 10 = = = p k b . 00005 . 0 0000333 . 0 10 6667 . 0 rounding 0001 . 0 0000666 . 0 10 6666 . 0 chopping error relative error absolute ion to approximat point - floating 0 0 L L × + × + p Note that the above absolute errors are round-off errors (that is, they are the difference between a real number p and a floating-point approximation to p ). Question: What is the maximum possible relative error in the k -digit, base b , floating- point representation * p of a real number p ? With chopping : Every real number p lies in some interval ) , [ 1 t t b b for some integer t . The distance between 2 floating-point numbers in this interval is k t b . Therefore, the absolute error satisfies k t b p p < * . Thus, the relative error satisfies 1 * < t k t b b p p p since 1 t b p which implies that k b p p p < 1 * . See (3.9) on page 63 of the 5 th edition (page 68 of the 6 th edition). The quantity k b 1 is called the unit round-off (or the machine epsilon ). Note that it is independent of t and the magnitude of p . The number 1 k indicates approximately the number of significant base b
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/10/2011 for the course CSC 349 taught by Professor Oadje during the Spring '11 term at University of Victoria.

Page1 / 3

CSC_349_HANDOUT#3 - COMPUTER SCIENCE 349A Handout Number 3...

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

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