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 + bx^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 |p(x) < epsilon->display the value of x as the root and stop. If p(x)* p(x0)<0 -> 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 |p(xm) | >= epsilon • If p(x0)*P(xm) <0 ->root between x0 and x1, so x1 = xm • if p(xm)*p(x1) >0 -> 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 Below are 3 sample runs Enter a,b,c,d of ax^3+bx^2+cx+d=0: 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 ax^3+bx^2+cx+d=0: -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 ax^3+bx^2+cx+d=0: 0.5 87.8 45.2 23.4 No root found in the interval [-50,50]

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY