GNU Scientific Library - Bugs: bug #59710, Undefined behavior error in...
You are not allowed to post comments on this tracker with your current authentication level.
bug #59710: Undefined behavior error in Nonlinear Least-Squares Fitting
Submitter: | Patrick Alken <psa> | ||
Submitted: | Thu 17 Dec 2020 04:17:55 PM UTC | ||
Category: | None | Severity: | 3 - Normal |
Operating System: | Status: | Fixed | |
Assigned to: | None | Open/Closed: | Closed |
Release: |
Thu 17 Dec 2020 04:21:53 PM UTC, comment #1: |
Patrick Alken <psa> |
Thu 17 Dec 2020 04:17:55 PM UTC, original submission:
from zhoulai =dot= fu =at= gmail =dot= com
|
Patrick Alken <psa> |
Depends on the following items: None found
Items that depend on this one: None found
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2021-01-20 | psa | Status | None | Fixed | |
2020-12-17 | psa | Open/Closed | Open | Closed | |
2020-12-17 | psa | Attached File | - | Added nlfit_bug.c, #50503 |
Powered by Savane 3.13-4b48.
Corresponding source code
Thanks for your report. The problem is that on the first iteration,
the lambda value jumps to -12.8, and the value of exp(12.8 * 60) is too
large to represent in double precision, so infs and nans appear in the
residual vector and Jacobian matrix.
For this particular problem, the value of lambda should be > 0, however
there is no constraint placed to assure that, so when the first
iteration jumps to -12.8, bad numerical things happen.
I think the best solution for now is to adjust the model parameters a
little to prevent this type of behavior, and bring TMAX closer to 1
(instead of 40). A better solution would be to implement a constraint so
that lambda > 0, but this would require a lot of development effort.
Fixed in commit 7caac3346