FirstIndexNext

[bug-gsl] gsl_multiroot_test_delta (2007-11-07)

From: franky.backeljauw@........
Subject: gsl_multiroot_test_delta
Date: Wed, 7 Nov 2007 11:04:51 +0100 (CET)
To: bug-gsl@gnu.org

Hello,

when looking for a real root to a complex function using gsl_multiroot,
I discovered a bug in the gsl_multiroot_test_delta routine. This test
does the following:

double xi = gsl_vector_get(x,i);
double dxi = gsl_vector_get(dx,i);
double tolerance = epsabs + epsrel * fabs(xi) ;

if (fabs(dxi) < tolerance)
{
ok = 1;
}

However, in the case of a real root, the imaginary part is zero, and
also dxi = 0, so that tolerance = epsabs. If we now set epsabs = 0, then
fabs(dxi) = 0 < tolerance = epsabs = 0 will always fail, even though it is
the correct answer.

When checking the one-dimensional case, the gsl_root_test_delta code
contains the test

if (fabs(x1 - x0) < tolerance || x1 == x0)

The problem above can be eliminated by replacing the test with

if (fabs(dxi) < tolerance || dxi == 0)

which is the generalization of the one-dimensional test to the
multidimensional case.

Could you inform me about the status of this bug report?

Thank you very much for this nice library!

-- Regards,

----------------------------------------------------------------------
Franky Backeljauw (e-mail) franky.backeljauw@........
Universiteit Antwerpen (jabber) fbackelj@...........
Departement Wiskunde en Informatica (tel) (0032|0)3/265.38.55
----------------------------------------------------------------------