问题描述:
用牛顿迭代法求方程2x^3-4x^2+3x-6=0
#include
#include
int main()
{
double x = 1,x2;
do {
x2 = x;
x -= (2*x*x*x-4*x*x+3*x-6)/(6*x*x-8*x+3);
} while(fabs(x - x2) > 1e-6);
printf("root=%.2f\n",x);
}
本人数学不是很好,急求6*x*x-8*x+3怎么出来的?
我现在懂了,问题继续留着,别只打个原理,第一个看不懂,第二个等于没回答
#include
#include
int main()
{
double x = 1,x2;
do {
x2 = x;
x -= (2*x*x*x-4*x*x+3*x-6)/(6*x*x-8*x+3);
} while(fabs(x - x2) > 1e-6);
printf("root=%.2f\n",x);
}
本人数学不是很好,急求6*x*x-8*x+3怎么出来的?
我现在懂了,问题继续留着,别只打个原理,第一个看不懂,第二个等于没回答
问题解答:
我来补答展开全文阅读