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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started