This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: bug in root finding?
- To: Jon Danielsson <jond at rhi dot hi dot is>
- Subject: Re: bug in root finding?
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Tue, 13 Nov 2001 17:23:25 +0000 (GMT)
- Cc: gsl-discuss at sources dot redhat dot com
- References: <200111131644.QAA11406@krafla.rhi.hi.is>
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