Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long double newton(long double x, long double e, long double (*f) (long double), long double (*df) (long double)){
- long double dx = x - f(x) / df(x);
- long double c = x - dx;
- if (c < 0){
- c = c * (-1);
- }
- if (c < e){
- return dx;
- }
- return newton(dx, e, f, df);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement