MCS 471 --- Computer Problem 0 --- Spring 1997

Floating Point Arithmetic


Single program with computer output is due Friday 07 Feb 1997 in class.

Write a single program that combines the two following finite precision problems. You may use WATFOR77, regular Fortran, Pascal or C (Maple may also be used provided digits chopping precision is specified like 7 or 16 and reasonable effort made to follow the spirit of the problem) on the computer of your choice within reason for this problem. However, you must hand in both copies of your program source code and your computer output.

Determine the single and double precision machine epsilon,

MIN(EPS | EPS>0 & 1+EPS>1)

using the modification that follows of a "bisectioning approximation" (TEPS is the temporary approximate machine epsilon) code fragment:
                  TEPS=1
		  KMAX=100
		  K=1
            1     PRINT,TEPS,TEPS+1
                  IF(TEPS+1.LE.1..OR.K.GT.KMAX) GOTO 2
                  TEPS=TEPS/2
		  K=K+1
                  GOTO 1
            2     EPS=2*TEPS
                  PRINT,`FINAL ANSWER; K=',K
                  PRINT,EPS,EPS+1
		  PREC=1-LOG(EPS)/LOG(2.)
Modify this code for your computer and programming language with print statements to print out the results AND
  1. Name of Your Computer System with Processor if not well known,
  2. Name of Your Progamming Language Compiler version if not well known,
  3. Intermediate values of "TEPS" and "TEPS+1",
  4. Final Approximation the Machine Epsilon in "EPS",
  5. Final Approximation of the Precision in "PREC",
  6. The Same Three (3) Items from a modified copy of the above code fragment, modified for Double Precision (64bit=8bytes word)

NOTES:




Web Source: http://www.math.uic.edu/~hanson/mcs471cp0.html

Email Comments or Questions to Professor Hanson