-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected exception thrown by ibeta_inv with extremely small x. #961
Comments
I don't reproduce with MSVC, but I think I see the issue anyway. |
Change assert's in temme_method_1_ibeta_inverse to corrections when guess goes out of range. Change handling of non-convergence in second_order_root_finder to use bracketing when the end points are many orders of magnitude apart. Fixes: #961.
Referenced PR improves things quite a bit.... However, the ibeta is potentially so extreme, that most root finders will fail at some point. The function basically resembles a "square wave" in extreme cases switching from 0 to 1 in the blink of an eye and arbitrarily close to either end point. And for every extreme example, you can always create a worse one! |
Thanks @jzmaddock. I'll add that I wasn't originally intending to test the function with such a small |
* Fix ibeta_inv for very small p. Change assert's in temme_method_1_ibeta_inverse to corrections when guess goes out of range. Change handling of non-convergence in second_order_root_finder to use bracketing when the end points are many orders of magnitude apart. Fixes: #961. * Add missing copyright. [CI SKIP]
I'm using the develop branch, commit 82ccb85. The compiler:
The code below throws the exception
At line 122 of
ibeta_inverse.hpp
, the value ofx
that triggers the exception is -5.42101e-20.There are comments in the code below that give nearby values of the input
x
that exhibit different behaviors.ibeta_inv_tiny_x.cpp
:The text was updated successfully, but these errors were encountered: