Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve it without function In this problem, you will use Bisection method to find a root of a polynomial. Write a C program to

image text in transcribed

please solve it without function

In this problem, you will use Bisection method to find a root of a polynomial. Write a C program to find a root of a cubic polynomial p(x)-a x^3 + b x^2 +cx +d-0 in the interval [-50,50] if it exists. You program will first prompt for and read the coefficients a, b, c, and d of the polynomial Step#1: Locate the interval [x0,x1] containing the root as follows fix x0 to -50. Also initialize x1 to -50 for each value of x starting from -50 to 50 with increment of 1 If I p(x) I display the value of x as the root and stop If p(x)*p(x0)k0 -> assign x to x1 and get outside the loop (using break statement) Step#2 : Finding the root - After the loop, if x1 is still -50-> display "No root found inside [-50,50] and terminate - If not -> The root is in the latest interval [x0,x1] Then apply the following bisection procedure method o Compute xm (x1+x0)/2 which represents the middle of the interval [x0,x1] o While Ip(xm)| >- epsilon If p(x0)*p(xm) root between XO and x1, so x1 = xm if p(xm)*p(x1) root between xm and x1, so x0 = xm update xm-(x0+x1)/2 - Display the value of the root found and the number of iterations (repetitions) to obtain the root. Note: Define epsilon as a constant with a value = 1E-6

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

=+ If you are a parent (or planning to be parent someday),

Answered: 1 week ago

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago