bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] [bug #42220] Division by zero in "hybrid*" when initial guess


From: Oliver Ofenloch
Subject: [Bug-gsl] [bug #42220] Division by zero in "hybrid*" when initial guess is root
Date: Fri, 13 Jun 2014 09:03:22 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0

Follow-up Comment #2, bug #42220 (project gsl):

Hi!

My last psot was somewhat incomplete and did not contain all information. This
is th second try (hope i' doing better this time):

I am using GSL 1.15 on Ububntu 12.04 LTS 64 Bit with gcc 4.6.3.

The example program provided by Curran runs without problems on my machine. If
un-comment line 106 in bug_hybrid.c the test fails for
gsl_multiroot_fsolver_broyden.

Looking into the problem I found that function broyden_iterate calls GSL_ERROR
if lambda=p*v becomes zero. This may happen if the initial guess is the root
of the system or even if during iteration the current guess is too close to
the root of the system.

My first (quick and dirty) solution was to return GSL_EZERODIV instead of
calling GSL_ERROR and checking in the driving loop if the current guess is a
root of the system.

My suggestion for solving this problem a bit more satisfying is to pass the
desired precision via the vstate argument to the function broyden_iterate.
Then the function could check if it has reached a root and stop doing further
calculations. I think, this is the way the gsl_ode* functions do it.

As far as I can see, this problem affects all the multiroot solvers.

Kind regards

Oliver

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42220>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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