Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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+c x +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 [x021] 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] p(x)I assign x to x1 and get outside the loop (using break statement) display the value of x as the root and stop 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 [x0x1]. Then apply the following bisection procedure method o 0 Compute xm-(x1+x0)/2 which represents the middle of the interval [x0,x1] while lp(xm)| >=epsilon . If p(ko) plsm)c0 >root between x0 and x1, so x1-m if plxm)pl1) >0-> root between xm and x1, so xo-m e 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 Below are 3 sample runs Enter a,b,c,d of axA3+bxA2+cx+d: 0.5 0.88 1.2 7.5 The polynominal has root at x--3.591302 Found after 27 iterations psilon as a constant with a value 1E-6 Below are 3 sample runs Enter a,b.c,d of axA3+bxA2+cx+d o: 0.5 0.88 -1.2 7.5 The polynominal has root at x-3.591302 Found after 27 iterations Enter a,b,c,d of axa3+bx^2+cx+d-: -2.5 45.2 7.8 55.6 The polynominal has root at x-18. 316626 Found after 35 iterations Enter a,b,c,d of axA3+bxA2+cx+do: 0.5 87.8 45.2 23.4 No root found in the interval -50,50]

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 2 Lnai 9285

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Joao Gama ,Alipio Jorge ,Carlos Soares

1st Edition

3319235249, 978-3319235240

More Books

Students also viewed these Databases questions