21 realnum diff = next_est-current;
28 if (fabs(numer) >= 2.0*fabs(current*denom))
34 proposal = numer/denom;
37 if ((proposal-current)*(proposal-next_est) > 0.2*diff*diff)
107 if( delta > dab && delta < dcb )
163 if( delta > dab && delta < dcb )
188 double *x =
new double[n];
189 double *y =
new double[n];
190 for(
int i=0; i < n; ++i )
195 double a,b,siga,sigb;
196 linfit( n, x, y, a, siga, b, sigb );
207 double *x =
new double[n];
208 double *y =
new double[n];
209 for(
int i=0; i < n; ++i )
214 double a,b,siga,sigb;
215 linfit( n, x, y, a, siga, b, sigb );
278 double tol,
int max_iter,
int& err )
291 double b = 0.5*(a + c);
292 for(
int i = 0; i < max_iter && !track.
lgConverged(); i++ )
294 track.
add( b, (*f)(b) );
301 result = track.
root();
double p_midpoint() const
void set_NaN(sys_float &x)
void add(double x, double fx)
double p_denominator(double fa, double fb, double fc)
double Amsterdam_Method(double(*f)(double), double a, double fa, double c, double fc, double tol, int max_iter, int &err)
realnum next_val(realnum current, realnum next_est)
vector< pair< double, double > > p_history
int init_bracket(double x1, double fx1, double x2, double fx2)
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
bool linfit(long n, const double xorg[], const double yorg[], double &a, double &siga, double &b, double &sigb)
void p_set_root(double x)
double p_numerator(double dab, double dcb, double fa, double fb, double fc)