25#ifndef _gcem_incomplete_gamma_HPP
26#define _gcem_incomplete_gamma_HPP
57 return exp( -x + (a-T(1))*
log(x) - lg_term );
66 return( counter < 49 ? \
82 return( a > T(1000) ?
max(T(0),
min(z,a) - 11*
sqrt(a)) :
102 return( a > T(1000) ?
min(z, a + 10*
sqrt(a)) :
103 a > T(800) ?
min(z, a + 10*
sqrt(a)) :
104 a > T(500) ?
min(z, a + 9*
sqrt(a)) :
105 a > T(300) ?
min(z, a + 9*
sqrt(a)) :
106 a > T(100) ?
min(z, a + 8*
sqrt(a)) :
107 a > T(90) ?
min(z, a + 8*
sqrt(a)) :
108 a > T(70) ?
min(z, a + 7*
sqrt(a)) :
109 a > T(50) ?
min(z, a + 6*
sqrt(a)) :
132 return( depth < 100 ? \
136 (1 + (depth-1)*2 - a + z) );
157 return(
is_odd(depth) ? - (a - 1 + T(depth+1)/T(2)) * z : T(depth)/T(2) * z );
192 GCLIM<T>::quiet_NaN() :
195 GCLIM<T>::quiet_NaN() :
203 (a < T(10)) && (z - a < T(10)) ?
205 (a < T(10)) || (z/a > T(3)) ?
211template<
typename T1,
typename T2,
typename TC = common_return_t<T1,T2>>
238template<
typename T1,
typename T2>
240common_return_t<T1,T2>
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const
\cpp11
Definition: ArrayCwiseUnaryOps.h:620
static const long double gauss_legendre_50_points[50]
Definition: gauss_legendre_50.hpp:25
static const long double gauss_legendre_50_weights[50]
Definition: gauss_legendre_50.hpp:79
#define GCEM_INCML_GAMMA_MAX_ITER
Definition: gcem_options.hpp:173
auto sqrt(const UnitType &value) noexcept -> unit_t< square_root< typename units::traits::unit_t_traits< UnitType >::unit_type >, typename units::traits::unit_t_traits< UnitType >::underlying_type, linear_scale >
computes the square root of value
Definition: math.h:483
dimensionless::scalar_t log(const ScalarUnit x) noexcept
Compute natural logarithm.
Definition: math.h:349
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:241
constexpr common_t< T1, T2 > max(const T1 x, const T2 y) noexcept
Compile-time pairwise maximum function.
Definition: max.hpp:35
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
Definition: Eigen_Colamd.h:50
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:63
constexpr T incomplete_gamma_check(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:187
constexpr T incomplete_gamma_quad_lb(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:79
constexpr T incomplete_gamma_cf_1(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:176
constexpr T incomplete_gamma_quad_ub(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:99
constexpr T incomplete_gamma_cf_1_coef(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:154
constexpr T incomplete_gamma_quad_fn(const T x, const T a, const T lg_term) noexcept
Definition: incomplete_gamma.hpp:54
constexpr T incomplete_gamma_quad_inp_vals(const T lb, const T ub, const int counter) noexcept
Definition: incomplete_gamma.hpp:36
constexpr T incomplete_gamma_quad(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:117
constexpr T incomplete_gamma_cf_2_recur(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:129
constexpr T incomplete_gamma_cf_2(const T a, const T z) noexcept
Definition: incomplete_gamma.hpp:142
constexpr bool is_odd(const llint_t x) noexcept
Definition: is_odd.hpp:33
constexpr T incomplete_gamma_quad_weight_vals(const T lb, const T ub, const int counter) noexcept
Definition: incomplete_gamma.hpp:45
constexpr T incomplete_gamma_cf_1_recur(const T a, const T z, const int depth) noexcept
Definition: incomplete_gamma.hpp:163
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition: is_nan.hpp:45
constexpr TC incomplete_gamma_type_check(const T1 a, const T2 p) noexcept
Definition: incomplete_gamma.hpp:214