-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from mckib2/add-beta-underflow-patch
FIX: add upstream beta underflow patch
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
patches/0002-beta.hpp-prevent-ibeta_derivative-underflow-error.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/boost/math/special_functions/beta.hpp b/include/boost/math/special_functions/beta.hpp | ||
index 87e8950dc..f74937c1a 100644 | ||
--- a/boost/math/special_functions/beta.hpp | ||
+++ b/boost/math/special_functions/beta.hpp | ||
@@ -390,7 +390,7 @@ T ibeta_power_terms(T a, | ||
else | ||
{ | ||
T p1 = pow(b1, a / b); | ||
- T l3 = (log(p1) + log(b2)) * b; | ||
+ T l3 = (p1 != 0) && (b2 != 0) ? (log(p1) + log(b2)) * b : tools::max_value<T>(); // arbitrary large value if the logs would fail! | ||
if((l3 < tools::log_max_value<T>()) | ||
&& (l3 > tools::log_min_value<T>())) | ||
{ |