mirror of
https://github.com/boostorg/math.git
synced 2026-01-29 07:42:11 +00:00
When min and max differ by many orders of magnitude (as happens when one is zero for example), then bisection can take a very long time to iterate down to the root. Instead use a bracketing strategy which doubles the step size with each iteration until a bracket is found, then repeat recursively as required until we have a reasonably small interval. Note that this only kicks in when a Halley step goes out of bounds and we're therefore forced to thrash around looking for the root. Fixes: https://github.com/boostorg/math/issues/204.