home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_12
/
smith1.lis
< prev
next >
Wrap
File List
|
1991-09-26
|
346b
|
14 lines
#include <math.h>
#define ABSOLUTE_EPSILON 1e-10
#define RELATIVE_EPSILON 1e-6 /* 6 digits */
float xnew, xold;
xnew = 1.0; /* some initial estimate */
do {
xold = xnew;
xnew = solution_refinement (xold);
} while ( fabs(xnew - xold) > ABSOLUTE_EPSILON &&
fabs (xnew-xold) > fabs(xnew) * RELATIVE_EPSILON );