Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
~108 People Reached
Favorite Forums
Favorite Tags
c++ x 1
c x 1

1 Posted Topic

Member Avatar for lllmcv

[CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> float f(float x); float df(float x); int main(){ float x=-0.7; int i=0; float y; do{ printf("f(x) is %f",f(x)); y=x-(f(x)/df(x)); x=y; i=i+1; printf("repeats %d",i); printf("x is %f",x); }while (f(x)!=0); return(0);} float f(float x) { return (x+pow(exp,-10.0*pow(x,2.0))*cos(x)); } float df(x) { return ((1-20*x*exp^(-10*(x)^2)*cos(x)-exp^(-10*(x)^2)*sin(x))); }[/CODE]

Member Avatar for emrecaglarhosgo
-1
108

The End.