bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl_multiroot_test_delta


From: franky . backeljauw
Subject: [Bug-gsl] gsl_multiroot_test_delta
Date: Wed, 7 Nov 2007 11:04:51 +0100 (CET)

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) address@hidden
Universiteit Antwerpen                   (jabber) address@hidden
Departement Wiskunde en Informatica          (tel) (0032|0)3/265.38.55
----------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]