Problem 2. Evaluate the function f(x)=x+1-1 for different values of x using a six-digit rounding computer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 2. Evaluate the function f(x)=x+1-1 for different values of x using a six-digit rounding computer arithmetic. a) Use hand calculations to evaluate f(x) at x = 0.001, and show how the identity a - b = (a - b)(a+ab+b) can be used to avoid catastrophic cancellation (or loss-of-significance errors) in this case. b) Write a MATLAB script to evaluate f(x) for a decreasing sequence of values of x. To be more precise, produce the results for each x (0.1.0.01, 0.001, 0.0001, 0.00001}, generate a table with the results obtained from a six-digit rounding computer arithmetic, the true values of f(x) (obtained from a double precision computer arithmetic), and the associated relative errors. c) Extend your MATLAB script from Part b) to evaluate f(x) by modifying f(x) according to Part a), and generate the same table as in Part b) (with different results). d) Compare the two tables found in Parts b) and c), and give a brief statement. Hint: In MATLAB, use round (a, b, 'significant') to round a number a using b significant digits. Note, however, that the rounding will be performed on a binary basis rather than on a decimal basis. Turn in your MATLAB script for this problem. Remember to use your name in both the MATLAB filename and the MATLAB script, and upload your MATLAB script to gradescope. Problem 2. Evaluate the function f(x)=x+1-1 for different values of x using a six-digit rounding computer arithmetic. a) Use hand calculations to evaluate f(x) at x = 0.001, and show how the identity a - b = (a - b)(a+ab+b) can be used to avoid catastrophic cancellation (or loss-of-significance errors) in this case. b) Write a MATLAB script to evaluate f(x) for a decreasing sequence of values of x. To be more precise, produce the results for each x (0.1.0.01, 0.001, 0.0001, 0.00001}, generate a table with the results obtained from a six-digit rounding computer arithmetic, the true values of f(x) (obtained from a double precision computer arithmetic), and the associated relative errors. c) Extend your MATLAB script from Part b) to evaluate f(x) by modifying f(x) according to Part a), and generate the same table as in Part b) (with different results). d) Compare the two tables found in Parts b) and c), and give a brief statement. Hint: In MATLAB, use round (a, b, 'significant') to round a number a using b significant digits. Note, however, that the rounding will be performed on a binary basis rather than on a decimal basis. Turn in your MATLAB script for this problem. Remember to use your name in both the MATLAB filename and the MATLAB script, and upload your MATLAB script to gradescope.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these mechanical engineering questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Please answer all questions from 1 to 12 4. Work-Power-Energy 7. A body of mass m, accelerates uniformly from rest to v, in time t,, The instantaneous power delivered to the body as a function of...
-
Briefly describe the self-concept theory of charismatic leadership.
-
Daniel B. Butler and Freida C. Butler, husband and wife, file a joint return. The Butlers live at 625 Oak Street in Corbin, KY 40701. Dan's Social Security number is 111-11-1112, and Freida's is...
-
Rule 4 (e) of the Federal Rules of Civil Procedure permits service by any method allowed by the state law in which the district court is sitting. Do a search to determine the service of process rules...
-
The report clearly needs to be redesigned. Design a report (or reports) that better suits Stephen Links. What approach can the analyst take in suggesting more reports with a less-crowded format?...
-
Jill has worked for Acme, Inc. for 30 years and she finished her last day at work at 5 pm today. Tonight there is a retirement party for Jill. Acme does not provide any retirement benefits for its...
-
The year end for a sole trader is 3 0 November 2 0 X 7 . The business pays for its gas by a standing order of 2 0 0 per month. On 1 December 2 0 X 6 , the statement from the gas supplier showed that...
-
Identify some of the basic issues managers must confront when attempting to motivate employees in different cultures.
-
Assume that you are leading a team composed of representatives from British, Mexican, Brazilian, and Egyptian subsidiaries of your firm. The team must make several major decisions. a. What guidelines...
-
The number of files on a computer In Exercises 1524, determine whether the data described are qualitative or quantitative.
-
In a case-control study, the outcome has occurred before the subjects are sampled. In Exercises 1116, determine whether the statement is true or false. If the statement is false, rewrite it as a true...
-
In a cross-sectional study, measurements are made at only one point in time. In Exercises 1116, determine whether the statement is true or false. If the statement is false, rewrite it as a true...
-
Rapidly rising health care costs have been a prominent political issue for decades. Since at least the 1970s, health care costs have increased faster than inflation. At the same time, wage growth in...
-
Which one of the following anhydrous chloride is not obtained on direct heating of its hydrated chloride? (A) BaCl2 (B) CaClz (C) MgCl2 (D) SrCl2
-
You wish to design an effusion source for Br atoms from Br 2 (g). If the source is to operate at a total pressure of 7.5 Torr, what temperature is required to produce a degree of dissociation of...
-
Why do magnetic field in-homogeneities of only a few parts per million pose difficulties in NMR experiments?
-
Using the matrix representation of the operators and spin eigenfunctions of Problem P28.7, show that the relationships listed in Equation (28.20) are obeyed. In Problem 28.7 Given that And Show that...
-
How do you classify a lathe? Explain briefly.
-
Differentiate between live and dead centres of a lathe.
-
List the various lathe accessories.
Study smarter with the SolutionInn App