25#ifndef _gcem_incomplete_gamma_HPP
26#define _gcem_incomplete_gamma_HPP
60 return exp( -x + (a-T(1))*
log(x) - lg_term );
69 return( counter < 49 ? \
85 return( a > T(1000) ?
max(T(0),
min(z,a) - 11*
sqrt(a)) :
105 return( a > T(1000) ?
min(z, a + 10*
sqrt(a)) :
106 a > T(800) ?
min(z, a + 10*
sqrt(a)) :
107 a > T(500) ?
min(z, a + 9*
sqrt(a)) :
108 a > T(300) ?
min(z, a + 9*
sqrt(a)) :
109 a > T(100) ?
min(z, a + 8*
sqrt(a)) :
110 a > T(90) ?
min(z, a + 8*
sqrt(a)) :
111 a > T(70) ?
min(z, a + 7*
sqrt(a)) :
112 a > T(50) ?
min(z, a + 6*
sqrt(a)) :
135 return( depth < 100 ? \
139 (1 + (depth-1)*2 - a + z) );
160 return(
is_odd(depth) ? - (a - 1 + T(depth+1)/T(2)) * z : T(depth)/T(2) * z );
206 (a < T(10)) && (z - a < T(10)) ?
208 (a < T(10)) || (z/a > T(3)) ?
214template<
typename T1,
typename T2,
typename TC = common_return_t<T1,T2>>
241template<
typename T1,
typename T2>
243common_return_t<T1,T2>
#define GCEM_INCML_GAMMA_MAX_ITER
Definition: gcem_options.hpp:173
constexpr T incomplete_gamma_check(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:190
constexpr T incomplete_gamma_quad_weight_vals(const T lb, const T ub, const int counter) noexcept
Definition: incomplete_gamma.hpp:48
constexpr T incomplete_gamma_quad_recur(const T lb, const T ub, const T a, const T lg_term, const int counter) noexcept
Definition: incomplete_gamma.hpp:66
constexpr T incomplete_gamma_cf_1_coef(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:157
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition: is_nan.hpp:48
constexpr T incomplete_gamma_quad_ub(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:102
constexpr T incomplete_gamma_quad_lb(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:82
constexpr bool is_odd(const llint_t x) noexcept
Definition: is_odd.hpp:36
constexpr T incomplete_gamma_cf_2_recur(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:132
constexpr T incomplete_gamma_quad_fn(const T x, const T a, const T lg_term) noexcept
Definition: incomplete_gamma.hpp:57
constexpr T incomplete_gamma_cf_1_recur(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:166
constexpr T incomplete_gamma_quad(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:120
constexpr TC incomplete_gamma_type_check(const T1 a, const T2 p) noexcept
Definition: incomplete_gamma.hpp:217
constexpr T incomplete_gamma_quad_inp_vals(const T lb, const T ub, const int counter) noexcept
Definition: incomplete_gamma.hpp:39
constexpr T incomplete_gamma_cf_2(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:145
constexpr T incomplete_gamma_cf_1(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:179
Definition: is_even.hpp:29
static const long double gauss_legendre_50_points[50]
Definition: gauss_legendre_50.hpp:28
constexpr common_t< T1, T2 > max(const T1 x, const T2 y) noexcept
Compile-time pairwise maximum function.
Definition: max.hpp:41
constexpr common_return_t< T1, T2 > incomplete_gamma(const T1 a, const T2 x) noexcept
Compile-time regularized lower incomplete gamma function.
Definition: incomplete_gamma.hpp:244
constexpr return_t< T > lgamma(const T x) noexcept
Compile-time log-gamma function.
Definition: lgamma.hpp:135
constexpr return_t< T > log(const T x) noexcept
Compile-time natural logarithm function.
Definition: log.hpp:186
constexpr return_t< T > sqrt(const T x) noexcept
Compile-time square-root function.
Definition: sqrt.hpp:109
static const long double gauss_legendre_50_weights[50]
Definition: gauss_legendre_50.hpp:82
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:41
std::numeric_limits< T > GCLIM
Definition: gcem_options.hpp:74