25#ifndef _gcem_incomplete_gamma_inv_HPP
26#define _gcem_incomplete_gamma_inv_HPP
55 return( T(1) - T(0.253) * a - T(0.12) * a*a );
66 return( t_val - (T(2.515517L) + T(0.802853L)*t_val + T(0.010328L)*t_val*t_val) \
67 / (T(1) + T(1.432788L)*t_val + T(0.189269L)*t_val*t_val + T(0.001308L)*t_val*t_val*t_val) );
76 return max( T(1E-04), a*
pow(T(1) - T(1)/(9*a) - value_inp/(3*
sqrt(a)), 3) );
98 T(1) -
log(T(1) - (p - t_val)/(T(1) - t_val)) );
113 p > T(0.5) ? T(-1) : T(1)) :
137 return( exp( - value + (a - T(1))*
log(value) - lg_val ) );
146 return( deriv_1*((a - T(1))/value - T(1)) );
173 return( ratio_val_1 /
max( T(0.8),
min( T(1.2), T(1) - T(0.5)*ratio_val_1*ratio_val_2 ) ) );
199 lg_val,iter_count+1) :
237template<
typename T1,
typename T2,
typename TC = common_return_t<T1,T2>>
265template<
typename T1,
typename T2>
267common_return_t<T1,T2>
#define GCEM_INCML_GAMMA_INV_MAX_ITER
Definition: gcem_options.hpp:177
constexpr T incomplete_gamma_inv_t_val_2(const T a) noexcept
Definition: incomplete_gamma_inv.hpp:52
constexpr T incomplete_gamma_inv_deriv_1(const T value, const T a, const T lg_val) noexcept
Definition: incomplete_gamma_inv.hpp:134
constexpr T incomplete_gamma_inv_initial_val(const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:106
constexpr T incomplete_gamma_inv_ratio_val_2(const T value, const T a, const T deriv_1) noexcept
Definition: incomplete_gamma_inv.hpp:161
constexpr T incomplete_gamma_inv_check(const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:217
constexpr T incomplete_gamma_inv_initial_val_1_int_end(const T value_inp, const T a) noexcept
Definition: incomplete_gamma_inv.hpp:73
constexpr T incomplete_gamma_inv_initial_val_2(const T a, const T p, const T t_val) noexcept
Definition: incomplete_gamma_inv.hpp:91
constexpr T incomplete_gamma_inv_ratio_val_1(const T value, const T a, const T p, const T deriv_1) noexcept
Definition: incomplete_gamma_inv.hpp:152
constexpr T incomplete_gamma_inv_decision(const T value, const T a, const T p, const T direc, const T lg_val, const int iter_count) noexcept
Definition: incomplete_gamma_inv.hpp:191
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition: is_nan.hpp:48
constexpr T incomplete_gamma_inv_halley(const T ratio_val_1, const T ratio_val_2) noexcept
Definition: incomplete_gamma_inv.hpp:170
constexpr T incomplete_gamma_inv_initial_val_1_int_begin(const T t_val) noexcept
Definition: incomplete_gamma_inv.hpp:63
constexpr TC incomplete_gamma_inv_type_check(const T1 a, const T2 p) noexcept
Definition: incomplete_gamma_inv.hpp:240
constexpr T incomplete_gamma_inv_deriv_2(const T value, const T a, const T deriv_1) noexcept
Definition: incomplete_gamma_inv.hpp:143
constexpr T incomplete_gamma_inv_begin(const T initial_val, const T a, const T p, const T lg_val) noexcept
Definition: incomplete_gamma_inv.hpp:207
constexpr T incomplete_gamma_inv_recur(const T value, const T a, const T p, const T deriv_1, const T lg_val, const int iter_count) noexcept
Definition: incomplete_gamma_inv.hpp:179
constexpr T incomplete_gamma_inv_err_val(const T value, const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:125
constexpr T incomplete_gamma_inv_initial_val_1(const T a, const T t_val, const T sgn_term) noexcept
Definition: incomplete_gamma_inv.hpp:82
constexpr T incomplete_gamma_inv_t_val_1(const T p) noexcept
Definition: incomplete_gamma_inv.hpp:43
Definition: is_even.hpp:29
constexpr T abs(const T x) noexcept
Compile-time absolute value function.
Definition: abs.hpp:40
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
constexpr common_t< T1, T2 > pow(const T1 base, const T2 exp_term) noexcept
Compile-time power function.
Definition: pow.hpp:82
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:41
constexpr common_return_t< T1, T2 > incomplete_gamma_inv(const T1 a, const T2 p) noexcept
Compile-time inverse incomplete gamma function.
Definition: incomplete_gamma_inv.hpp:268
std::numeric_limits< T > GCLIM
Definition: gcem_options.hpp:74