Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Verify that the relative accuracy of all floating - point numbers will be between eps / 2 and eps. Plot the relative accuracy of floating
Verify that the relative accuracy of all floatingpoint numbers will be between eps and eps.
Plot the relative accuracy of floatingpoint numbers between and :
Define a rowarray variable to contain evenlyspaced values between and Using the linspace function.
Calculate the relative accuracy of the numbers in the row array using dotarray operators and the function eps.
Plot the relative accuracy divided by eps. The plot should show that the relative accuracy of floatingpoint numbers lies in the range eps and eps.
Function to plot the relative accuracy between two floatingpoint numbers.
Now, write a function that will plot the relative accuracy betwee two floatingpoint numbers.
Write a script that prompts the user to enter two numbers and then call the function to plot the result.
Using the script you created, experiment with other floatingpoint number ranges and confirm that the relative accuracy of floatingpoint numbers always lies in the range eps and eps.
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