#include<stdio.h>
#include<math.h>
float f(float x)
{
float f;
f=x*x*x/3-x;
return(f);
}
float df(float x)
{
float df;
df=x*x-1;
return (df);
}
int main()
{
float x0=0,x1,d;
float eps=0.000005,delta=0;
while(x0==0)
{
delta=delta+0.000001;
x0=x0+delta;
do
{
d=-f(x0)/df(x0);
x1=x0+d;
x0=x1;
}
while(fabs(d)>eps);
}
delta=delta-0.000001;
printf("尽可能大的值=%f\n",delta);
system("pause");
return 0;
}
确定误差
最新推荐文章于 2023-04-20 16:32:51 发布