1 #ifndef STAN_MATH_PRIM_SCAL_ERR_CHECK_2F1_CONVERGES_HPP 2 #define STAN_MATH_PRIM_SCAL_ERR_CHECK_2F1_CONVERGES_HPP 33 template <
typename T_a1,
typename T_a2,
typename T_b1,
typename T_z>
35 const T_a2& a2,
const T_b1& b1,
const T_z& z) {
45 bool is_polynomial =
false;
59 && (is_polynomial ||
fabs(z) < 1 || (
fabs(z) == 1 && b1 > a1 + a2)))
62 std::stringstream msg;
63 msg <<
"called from function '" <<
function <<
"', " 64 <<
"hypergeometric function 2F1 does not meet convergence " 65 <<
"conditions with given arguments. " 66 <<
"a1: " << a1 <<
", a2: " << a2 <<
", " 67 <<
"b1: " << b1 <<
", z: " << z;
fvar< T > fabs(const fvar< T > &x)
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
bool is_nonpositive_integer(T x)
Returns true if the input is a nonpositive integer and false otherwise.
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
void domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
fvar< T > floor(const fvar< T > &x)
void check_2F1_converges(const char *function, const T_a1 &a1, const T_a2 &a2, const T_b1 &b1, const T_z &z)
Check if the hypergeometric function (2F1) called with supplied arguments will converge, assuming arguments are finite values.