27#ifndef _gcem_incomplete_beta_HPP
28#define _gcem_incomplete_beta_HPP
34constexpr T
incomplete_beta_cf(
const T a,
const T
b,
const T z,
const T c_j,
const T d_j,
const T f_j,
const int depth)
noexcept;
45 return( -z*(a + k)*(a +
b + k)/( (a + 2*k)*(a + 2*k + T(1)) ) );
54 return( z*k*(
b - k)/((a + 2*k - T(1))*(a + 2*k)) );
110incomplete_beta_cf(
const T a,
const T
b,
const T z,
const T c_j,
const T d_j,
const T f_j,
const int depth)
128 return ( (exp(a*
log(z) +
b*
log(T(1)-z) -
lbeta(a,
b)) / a) * \
143 GCLIM<T>::quiet_NaN() :
148 (a + T(1))/(a +
b + T(2)) > z ? \
153template<
typename T1,
typename T2,
typename T3,
typename TC = common_return_t<T1,T2,T3>>
185template<
typename T1,
typename T2,
typename T3>
187common_return_t<T1,T2,T3>
#define GCEM_INCML_BETA_TOL
Definition: gcem_options.hpp:161
#define GCEM_INCML_BETA_MAX_ITER
Definition: gcem_options.hpp:165
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
dimensionless::scalar_t log(const ScalarUnit x) noexcept
Compute natural logarithm.
Definition: math.h:349
constexpr common_return_t< T1, T2, T3 > incomplete_beta(const T1 a, const T2 b, const T3 z) noexcept
Compile-time regularized incomplete beta function.
Definition: incomplete_beta.hpp:188
constexpr common_return_t< T1, T2 > lbeta(const T1 a, const T2 b) noexcept
Compile-time log-beta function.
Definition: lbeta.hpp:36
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_beta_begin(const T a, const T b, const T z) noexcept
Definition: incomplete_beta.hpp:125
constexpr T incomplete_beta_decision(const T a, const T b, const T z, const T c_j, const T d_j, const T f_j, const int depth) noexcept
Definition: incomplete_beta.hpp:94
constexpr T incomplete_beta_coef(const T a, const T b, const T z, const int depth) noexcept
Definition: incomplete_beta.hpp:60
constexpr T incomplete_beta_d_update(const T a, const T b, const T z, const T d_j, const int depth) noexcept
Definition: incomplete_beta.hpp:82
constexpr TC incomplete_beta_type_check(const T1 a, const T2 b, const T3 p) noexcept
Definition: incomplete_beta.hpp:156
constexpr T incomplete_beta_coef_odd(const T a, const T b, const T z, const int k) noexcept
Definition: incomplete_beta.hpp:51
constexpr bool is_odd(const llint_t x) noexcept
Definition: is_odd.hpp:33
constexpr T incomplete_beta_coef_even(const T a, const T b, const T z, const int k) noexcept
Definition: incomplete_beta.hpp:42
constexpr T incomplete_beta_check(const T a, const T b, const T z) noexcept
Definition: incomplete_beta.hpp:138
constexpr T incomplete_beta_cf(const T a, const T b, const T z, const T c_j, const T d_j, const T f_j, const int depth) noexcept
Definition: incomplete_beta.hpp:110
constexpr T incomplete_beta_c_update(const T a, const T b, const T z, const T c_j, const int depth) noexcept
Definition: incomplete_beta.hpp:73
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition: is_nan.hpp:45