Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- values_t *newton_iter(double x0, long max, double stopcon)
- {
- long i;
- double x;
- values_t *val=values_allocate(max);
- if(values_insert(val, x0, mySin(x0),0)==FALSE)
- return 0;
- for(i=0;i<max-1;i++)
- {
- if(fabs(val->funcval[i])<stopcon)
- {
- printf("Nullstelle gefunden bei x=%f\n", val->arg[i]);
- return val;
- }
- x = newton_step(val->arg[i],mySin,myCos);
- if(values_insert(val, x, mySin(x),i+1)==FALSE)
- return 0;
- }
- return val;
- }
Add Comment
Please, Sign In to add comment