Question: 10. (a) Write a Matlab or Fortran or C code to compute the machine epsilon mach (using the pseudocode on page 47) in single precision.

10. (a) Write a Matlab or Fortran or C code to compute the machine epsilon mach (using the pseudocode on page 47) in single precision. Your output should print: the machine epsilon = ...

machine epsilon pseudocode on page 47:

epsi <--- 1.0

while (1.0 + eps >-/1.0)

epsi <---- epsi/2.0

end for

epsi <--- 2.0 * epsi

(b) Modify your code and also find the double precision machine epsilon mach on the computer you use.

(c) Comparing your single and double precision answers for the machine epsilon, how many digits does double precision add to the mantissa and how many to the exponent?

(d) Matlab has it a built-in constant, eps. Type: matlab eps Maple has one too. Type: maple readlib(Maple_floats): evalhf(DBL_EPSILON); Do the values from (a)(d) agree? Which one is correct?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!