CS 210 PROJECT #5 Due: 10am Wednesday 05/02/2007 This project provides students an encounter with x86 floating-point data-formats and instructions, in the context of computing a real number that has special significance in mathematics and science. PROBLEM STATEMENT An important real number, which arises in calculus from studying an infinite summation process, is Euler's number e , obtained by adding up the reciprocal-factorials 1/n! for every nonnegative integer n . Due to rapid growth in the size of the denominator n! as n increases, it is only necessary to add up the early terms from the progression 1/0!, 1/1!, 1/2!, 1/3!, ... , 1/n!, ... in order to reach a total which is almost equal to the sum of all values in this inifnite list, because most of these fractions are so small that their contribution to the total is negligible. It is easy to see that a value for e would exceed 2.5 (= 1 + 1 + 1/2), and by remembering from High School the formula for the sum an infinite geometric series, it can be seen that all the remaining terms, after the first three, will add up to less than 1/4: 1/3! + 1/4! + 1/5! + 1/6! + ... < 1/6 + 1/6*3 + 1/6*9 + 1/6*27 + ... The geometric series on the right has the sum a/(1-r) = (1/6)/(2/3) , so Euler's number e must lie somewhere between 2.50 and 2.75. In this project you are asked to compute a more accurate estimate of e , by using the floating-point instructions to add up the first ten terms in the series of reciprocal-factorials of nonnegative integers: sum = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! + ... + 1/9! ADDITIONAL REQUIREMENTS AND PERMISSIONS Your program should be named 'eulernum.s' and it should produce a line of screen-output that shows e's value to four decimal-places: e = 2.xxxx For this project you may use the source-code from our demo 'flt2asc.s' distributed and discussed in class (it does not make use of any of the floating-point instructions). The usual project-submission guidelines apply to this project: turn in a printout of your 'eulernum.s' source, and copy all your files to your '/submit' directory. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2007