Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use Java to write the code. also a screen shot of the code and the output thank you Print out the values of h,

please use Java to write the code.

also a screen shot of the code and the output

thank you

image text in transcribed

Print out the values of h, your approximation to f'(x), and the error in the approximation for each value of h used. This error will include the effects of both truncation and rounding. Write down (in your output file or in another file submitted with your program) any conclusions that you can make from these experiments .

Design and construct a computer program in one of the following languages (e.g., C, C++, C#, Java, Pascal, or Python) that will illustrate the effects of rounding errors and truncation errors. Be sure to follow the documentation and programming style policies of the Computer Science Department. The following is a plot of the function f(x) = sin(x4) + x2: -1.0 -0.5 - 0.5 10 15 20 In order to illustrate the effects of the two major error sources, rounding and truncation, attempt to determine an approximation to the derivative of f(x) at x=2.0 radians using the difference approximation given below. (The true answer is 4+ 32 cos(16) or about -26.64510337034830854). Use the formula: f'(x) = (f(x+h) - f(x)) /h with h=1, 0.5, 0.25, ... 1.8189894035459e-12 (i.e., keep halving h until it is less than 2.0e-12.) Design and construct a computer program in one of the following languages (e.g., C, C++, C#, Java, Pascal, or Python) that will illustrate the effects of rounding errors and truncation errors. Be sure to follow the documentation and programming style policies of the Computer Science Department. The following is a plot of the function f(x) = sin(x4) + x2: -1.0 -0.5 - 0.5 10 15 20 In order to illustrate the effects of the two major error sources, rounding and truncation, attempt to determine an approximation to the derivative of f(x) at x=2.0 radians using the difference approximation given below. (The true answer is 4+ 32 cos(16) or about -26.64510337034830854). Use the formula: f'(x) = (f(x+h) - f(x)) /h with h=1, 0.5, 0.25, ... 1.8189894035459e-12 (i.e., keep halving h until it is less than 2.0e-12.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions