# | Line 1 | Line 1 | |
---|---|---|
1 | + | { RCSid $Id$ } |
2 | { | |
3 | root.cal - calculate zeroes of functions using Newton's method. | |
4 | ||
# | Line 18 | Line 19 | abs(x) = if(x, x, -x); | |
19 | lim(x) = if(x, max(x,err), -max(-x,err)); | |
20 | max(a,b) = if(a-b, a, b); | |
21 | ||
22 | < | f1(f,x) = (f(x+FTINY)-f(x-FTINY))/FTINY/2; { numerical derivative } |
22 | > | f1(f,x) = (f(x+FTINY)-f(x-FTINY))/(2*FTINY); { numerical derivative } |
23 | ||
24 | err = 1e-6; | |
25 | nit = 100; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |