GNU Scientific Library - Bugs: bug #42220, Division by zero in...
You are not allowed to post comments on this tracker with your current authentication level.
bug #42220: Division by zero in "hybrid*" when initial guess is root
Submitter: | Patrick Alken <psa> | ||
Submitted: | Mon 28 Apr 2014 03:43:33 PM UTC | ||
Category: | Runtime error | Severity: | 3 - Normal |
Operating System: | Status: | None | |
Assigned to: | None | Open/Closed: | Open |
Release: |
Fri 13 Jun 2014 09:03:22 AM UTC, comment #2: |
Oliver Ofenloch <ofi> |
Thu 12 Jun 2014 01:07:04 PM UTC, comment #1: Hi!
|
Oliver Ofenloch <ofi> |
Mon 28 Apr 2014 03:43:33 PM UTC, original submission:
Hello GSL team,
|
Patrick Alken <psa>![]() |
Depends on the following items: None found
Items that depend on this one: None found
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2014-04-28 | psa | Attached File | - | ![]() |
Added bug_hybrid.c, #31266 |
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