Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that calculates the derivative using three methods (the forward derivative, backward derivative, and the centered derivative) of a function that is

image text in transcribed
Write a C++ program that calculates the derivative using three methods (the forward derivative, backward derivative, and the centered derivative) of a function that is defined separately from the main() part of the code. Have the user specify the value of , but print out the results for different step sizes: 01, 0.01, 0.001, and 0.0001 Use this code to calculate the derivatives of ( and sinh r for three values of 0.0,1.5, and 10.0. Use the smallest step size of the centered derivative to define the "correct" value (this is assuming no round-off error, of course), and determine the percent accuracy of each method/step size. Note: do not compare your result to the analytic result

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

Step: 3

blur-text-image

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions