math
math copied to clipboard
add `hypergeometric_1F1`, `log_hypergeometric_1F1` and their gradients
Boost has both of these functions.
The hypergeometric 1F1 function is interesting in that the lower incomplete gamma function can be expressed as
$$ \gamma(a, x) = a^{-1} x^a { _1F_1(a, 1 + a, -x)} $$
Once the 2F1 is in, I'll also be working these up (if you haven't started already!). Since the gamma_p_inv and gamma_q_inv gradients involve a $_2F_2(a,a; a+1,a+1)$ call, which we can express using the 1F1 (eqn. 24 in this paper). Note that the identity still requires a call to $_2F_2(1,1; 2,2)$ , but this can also be represented pretty trivially in closed form