This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ate to 0.0—the value 3.14 would be lost due to rounding. On the other hand, the expression 3.14+(1e10-1e10) would evaluate to 3.14. As with an Abelian group, most values have inverses under ﬂoating-point addition, that is, Ü +f Ü ¼. The exceptions are inﬁnities (since ·½ ½ Æ Æ ), and Æ Æ ’s, since Æ Æ +f Ü Æ Æ for any Ü. The lack of associativity in ﬂoating-point addition is the most important group property that is lacking. It has important implications for scientiﬁc programmers and compiler writers. For example, suppose a compiler is given the following code fragment:
x = a + b + c; y = b + c + d; The compiler might be tempted to save one ﬂoating-point addition by generating the code:
t = b + c; 2.4. FLOATING POINT
x = a + t; y = t + d; 77 However, this computation might yield a different value for x than would the original, since it uses a different association of the addition operations. In most applications, the difference would be so small as to be inconsequential. Unfortunately, compilers have no way of knowing what trade-offs...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American