Question: Write a script to compute machine ( about 1 ) using a while loop. Your code should output the value of along with a message
Write a script to compute machine about using a while loop. Your code should
output the value of along with a message explaining what means. For extra credit use the
IEEE standard for double precision given in class to show by hand that your computed value is
correct.
pts The following algorithm calculates a value similar to machine called machine delta.
Set
While repeat
a
b
Output
Stop
Write a script to find and print machine delta. Explain what is and why it is so different than
machine For extra credit use the IEEE standard for double precision given in class to show by
hand that your computed value is correct.
pts For this problem you want to estimate the derivative of the function at
See Lab for the definition of Use both the forward difference,
and the centered difference
For the step sizes, let
with For find and save the absolute
true errors
for each difference approximation and step size.
a Find the true value by hand using the definition of given in Lab
b Plot the log of the absolute error versus the log of for both the forward and the
centered approximation on the same set of axes. Do not use Matlabs loglog command.
c Add a title, axes labels, and a legend.
d Use Matlabs Basic Fitting Tool to find the slope, for each difference approximation.
e Report the slopes you find and explain their values mathematically. Hint: If an error is
then it is proportional to while if it is it is proportional to
f Finally, experiment with to determine the optimum step size, for each difference
approximation, that best balances the truncation and the roundoff errors.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
