Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define eps 1e-6
- double f(double x)
- {
- return (1./5*(6 - x*x + 4*x));
- }
- int main(void)
- {
- int i;
- double x=1.5, y, delta;
- do
- {
- y=f(x);
- delta=fabs(y-x);
- x=y;
- printf("%lf \t %lf \n",x,f(x));
- } while (delta > eps);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement