Question: We will implement the Secant Method in C code to find ONE root of the polynomial function: f ( x ) = - 0 .

We will implement the Secant Method in C code to find ONE root of the polynomial function: f(x)=-0.98x3+18.35x2-0.087x +0.90004 Instructions: Create a program that implements the secant method. You will need to: 1. Prompt & read input from the user (for initial X values X0 and X1).2. Create a function (outside the main function) for the polynomial equation, whose input is the value of X and the output returned will be the value of F(X) defined by the polynomial. 3. Create a loop within the main function to calculate the next value of X (using the given steps of the secant method).4. Terminate the loop when F(X) value is almost zero. This can be achieved by using an if statement to check if F(X)< epsilon, where epsilon is a selected level of precision. Ex: set epsilon=0.001 and the loop will terminate when F(X)<0.001(almost zero).5. Display the final (converged) value of X.6. Display the number of iterations (of the loop) that were needed for the solution. 7. Display an error message if the input from the user is invalid, or if the secant method does not converge to a solution.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!