Question: *********** Part C********** (1) Computing the machine precision (i.e. machine epsilon): (a) Machine precision is defined as the smallest number which when added to one,
***********Part C**********
(1) Computing the machine precision (i.e. machine epsilon): (a) Machine precision is defined as the smallest number which when added to one, produces a result different from one. Write a C program to compute machine precision for float and for double (Start with em = 1. In each iteration, halve the value of EM ,. till you get a value that when added to 1, does not produce a number different from 1). Print everything with the format string %16.12E. (b) What value would you expect? Are the values you obtain, the ones you expect? If yes, show this (by printing out the value) and if no, explain your result. The function pow(n, a) (you will need to use the header file math.h) computes n. (c) The machine precision determines the gap between successive floats. To test this, use your program to print: X * (1 EM), X, X * (1 +EM). Next print x * (1 +m/2). What value do you get? Explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
