Supplied more explanations 17 September 2004.
Consider a MATLAB program that investigates the double precision epsilon. You may also use C (C, GNU C, C++ or other C) or Fortran (F77, F90, or other F) or Maple provided digits rounding precision are specified as 16 or more and reasonable effort made to follow the spirit of the problem. Use the computer of your choice, within reason for this problem. MATLAB can be found in the UIC PCLabs and some department computer labs. However, you must hand in copies of both your
where (1+eps) denotes the appropriate float[1+eps]>1) generated by the computer arithmetic in the given precision.
Use the following modified "bisectioning approximation" pseudo code fragment:
kmax = 100; eps0 = 1; for k = 1 to kmax epssave = eps0; ks = k - 1; eps0 = eps0/2; # Bisection Step. epsplus1 = eps0+1; print, eps0, epsplus1; if(epsplus1 .le. 1.e0) break; # ".le." means "less than or equal" end print, epssave, epssave+1; # Actual Answer is One Prior to Break. pchop = 1-log(epssave)/log(2.e0); # Base 2 Precision? print, pchop; eps0 = 0; deleps = 2^(-1-pchop); print, deleps; for k = 1 to 7 # Refinement Check. eps0 = eps0 + deleps; epsplus1 = eps0+1; print, eps0, epsplus1; endComments are preceded by the symbol #.
Use the sample MATLAB code to start: m-file eps64.m However, you may simply convert it to C, F or Maple if you wish.
Please answer the 3 specific questions in the code ( eps64.m) and also answer the additional 4 questions:
Email Comments or Questions (MCS 471 only, please) to hanson A T math uic edu