2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-02 08:52:15 +00:00

Changed asymptotic selection criteria to match previous implementations

This commit is contained in:
Jacob Hass
2026-01-13 09:32:20 -08:00
parent 038cb2b887
commit 9abdc80f15

View File

@@ -1827,9 +1827,8 @@ BOOST_MATH_GPU_ENABLED T lgamma_incomplete_lower_imp(T a, T x, const Policy& pol
if(x < 0)
return policies::raise_domain_error<T>(function, "Argument x to the incomplete gamma function must be >= 0 (got x=%1%).", x, pol);
// This still needs work...
if (a > x + 50){
std::cout << "Using approximation" << std::endl;
// Taken from conditions on Line 1354, 1368, 1709
if (((a > 4 * x) && (a >= max_factorial<T>::value)) || (T(-0.4) / log(x) < a) || ((x * 0.75f < a) && x < T(1.1))){
return log(detail::lower_gamma_series(a, x, pol)) - log(a) + a * log(x) - x - lgamma(a, pol);
}