#include
#include
//原函数
double Func(double x)
{
return x*x*x*x*x+35*x*x*x*x-25*x*x*x+10*x*x+x+9;
}
//导函数
double DerivedFunc(double x)
{
return 5*x*x*x*x+140*x*x*x-75*x*x+20*x+1;
}
//与0的比较
BOOL IsZero(double x)
{
return (x = -0.000001);
}
BOOL newton(double *x,double precision,int maxcyc)
{
double x1,x0;
int k;
x0=*x;
for(k=0;k