This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in root finding?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]