#include
#include
#define F(x) 2*x*x*x-4*x*x+3*x-7//The function
#define K(x) 6*x*x-8*x+3//The pitch
void main()
{
double x,xx,f,k;
x=2.5;
f=F(x);//Get the value
k=K(x);//Get the pitch value
xx=x-f/k;
while((fabs(x-xx))>(1*10e-6))//Check the answer
{
x=xx;
f=F(x);//Get the value
k=K(x);//Get the pitch value
xx=x-f/k;
}
printf("x=%2.8f,xx=%2.8fn",x,xx);
}
//该程序经过调试成功的