Question: Write a C program, polynomial.h, containing the following functions: 1. void display polynomial (float pl). int n, float x), which prints the polynomial in format

 Write a C program, polynomial.h, containing the following functions: 1. void
display polynomial (float pl). int n, float x), which prints the polynomial

Write a C program, polynomial.h, containing the following functions: 1. void display polynomial (float pl). int n, float x), which prints the polynomial in format like p[0]*x"{n-1) + p[1]*x" {n-2) +...+pIn-2]*x"1 + pln-1]*x*0 with 2 digits after the point, e.g., 1.00*10.00 32.00*10.00 243.00*10.00 1+4.00*10.000 2. float horner (float p[], int n, float x), which computes and returns the value of the following polynomial P(x) of order n and coefficients p[@], p[n-1). P(x) = p[0] *xn - 1 + p[1] *xn-2 + ... + p[n-2] *xl + p[n - 11 * x It is required to use Horner's algorithm (supplementary link). 3. float bisection (float p[], int n, float a, float b), which finds an approximate real root c in interval [a, b] of polynomial P(x), using the bisection method (supplementary link). Use the fault tolerant 1e-6 (or 0.000001) as a stop condition, i.e., if xo is the actual root, stop the iteration if Ic-x0] #include #include #include "polynomial.h" int main() { int n = 4; float p[] = {1, 2, 3, 4); int m = 3; float x[] {0,1,10); // test display and horner functions int i; for (i=0; i

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 Databases Questions!