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
Ranked #107.84K
1 Posted Topic
[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]
The End.
lllmcv