Opened 7 years ago
Closed 7 years ago
#11532 closed Bugs (fixed)
toms748_solve produces -nan when evaluating a smooth function in a fixed interval
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In my algorithm that is finding the point where two gamma gamma distributions crosses, the toms748 solver produces a -nan value for the evaluation point. The behaviour occurs quite rarely, and only for extremely specific values of the governing parameters. I have not checked if the problem is cross platform.
I see that the solver evaluates the same point twice, and suspect that the subsequent calculation of the change of the evaluation point somehow divides by 0.
A minimal example is enclosed.
Attachments (1)
Change History (4)
by , 7 years ago
comment:2 by , 7 years ago
Thanks, I tried to reproduce with msvc but no luck, I'll look into GCC later.
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
There's a typo/bug in the root bracketing code, fixed in https://github.com/boostorg/math/commit/8a29241cc3a59fe04b10ab6937d8eefe07dd85fb
Note this will not be in the next release which already in beta.
Minimal example, compile with: g++ -std=c++11 -fPIC -O2 -o test test.cpp