bug in root finding?

Brian Gough bjg@network-theory.co.uk
Wed Dec 19 13:20:00 GMT 2001


Jon Danielsson writes:
 > I am using gsl 1.0 on RH7.2, and encountered the problem that when
 > the rootfinder (gsl_root_fsolver_alloc (gsl_root_fsolver_brent);
 > finds the solution immeately, i.e. its brackeded between -100,100 
 > on third function evaluaiton it zero, which is the exact solution, but
 > then fails to recognize the fact, loops until max_iter is reached
 > 		status = gsl_root_test_interval (x_lo,x_hi, 0, 0.00001);

Hi, 

The relative tolerance drops out if the root is zero, so the
convergence test needs a small absolute tolerance, e.g. DBL_MIN.  See
roots/convergence.c for the inequality used.  Arguably an exact root
of zero needs to be handled as a special case, but it is not done that
way in the present code so thanks for reporting it.

regards
Brian Gough



More information about the Gsl-discuss mailing list