#include <stdio.h>
#include <math.h>
#include <original_function.c>
float f(float x){
// int i,j;
float dd1,dd2;
float dy;
float dx;
f(x)=x*x;
dx=0.05;
dy=g(x)-g(x+dx);
dd1=dy/dx;
Lab;
dx=0.5*dx;
dy=g(x)-g(x+dx);
dd2=dy/dx;
if(fabs(dd1-dd2)<1e-6)
{return dd2;}
else
{dd1=dd2; goto Lab;};
}
- 1
- 2
- 3
前往页