25#ifndef _gcem_incomplete_gamma_inv_HPP
26#define _gcem_incomplete_gamma_inv_HPP
52 return( T(1) - T(0.253) * a - T(0.12) * a*a );
63 return( t_val - (T(2.515517L) + T(0.802853L)*t_val + T(0.010328L)*t_val*t_val) \
64 / (T(1) + T(1.432788L)*t_val + T(0.189269L)*t_val*t_val + T(0.001308L)*t_val*t_val*t_val) );
73 return max( T(1E-04), a*
pow(T(1) - T(1)/(9*a) - value_inp/(3*
sqrt(a)), 3) );
95 T(1) -
log(T(1) - (p - t_val)/(T(1) - t_val)) );
110 p > T(0.5) ? T(-1) : T(1)) :
143 return( deriv_1*((a - T(1))/
value - T(1)) );
170 return( ratio_val_1 /
max( T(0.8),
min( T(1.2), T(1) - T(0.5)*ratio_val_1*ratio_val_2 ) ) );
196 lg_val,iter_count+1) :
219 GCLIM<T>::quiet_NaN() :
224 GCLIM<T>::quiet_NaN() :
226 GCLIM<T>::infinity() :
234template<
typename T1,
typename T2,
typename TC = common_return_t<T1,T2>>
262template<
typename T1,
typename T2>
264common_return_t<T1,T2>
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const
\cpp11
Definition: ArrayCwiseUnaryOps.h:620
#define GCEM_INCML_GAMMA_INV_MAX_ITER
Definition: gcem_options.hpp:177
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
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_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:265
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_inv_deriv_1(const T value, const T a, const T lg_val) noexcept
Definition: incomplete_gamma_inv.hpp:131
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:79
constexpr T incomplete_gamma_inv_halley(const T ratio_val_1, const T ratio_val_2) noexcept
Definition: incomplete_gamma_inv.hpp:167
constexpr T incomplete_gamma_inv_err_val(const T value, const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:122
constexpr T incomplete_gamma_inv_t_val_2(const T a) noexcept
Definition: incomplete_gamma_inv.hpp:49
constexpr T incomplete_gamma_inv_initial_val(const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:103
constexpr T incomplete_gamma_inv_t_val_1(const T p) noexcept
Definition: incomplete_gamma_inv.hpp:40
constexpr T incomplete_gamma_inv_ratio_val_2(const T value, const T a, const T deriv_1) noexcept
Definition: incomplete_gamma_inv.hpp:158
constexpr T incomplete_gamma_inv_initial_val_1_int_end(const T value_inp, const T a) noexcept
Definition: incomplete_gamma_inv.hpp:70
constexpr TC incomplete_gamma_inv_type_check(const T1 a, const T2 p) noexcept
Definition: incomplete_gamma_inv.hpp:237
constexpr T incomplete_gamma_inv_check(const T a, const T p) noexcept
Definition: incomplete_gamma_inv.hpp:214
constexpr T incomplete_gamma_inv_initial_val_2(const T a, const T p, const T t_val) noexcept
Definition: incomplete_gamma_inv.hpp:88
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:204
constexpr T incomplete_gamma_inv_deriv_2(const T value, const T a, const T deriv_1) noexcept
Definition: incomplete_gamma_inv.hpp:140
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:149
constexpr T incomplete_gamma_inv_initial_val_1_int_begin(const T t_val) noexcept
Definition: incomplete_gamma_inv.hpp:60
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:188
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:176
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition: is_nan.hpp:45
constexpr common_t< T1, T2 > pow(const T1 base, const T2 exp_term) noexcept
Compile-time power function.
Definition: pow.hpp:76