最可怕的一道题,题目是这样的
Root of a Polynomial
A polynomial of degree nnn has the common form as p(x)=cn*x^n+cn−1*x^n−1+⋯+c1*x+c0. Your task is to write a function to find a root of a given polynomial in a given interval.
Format of function:
double Polynomial_Root(int n, double c[], double a, double b, double EPS);
where int n
is the degree of the polynomial; double c[]
is an array ofn
+1 coefficients cnc_nc