: term(1), b_minus_a_plus_n(b - a), a_(a), b_(b), z_(z), n(0), k(k_)
{
BOOST_MATH_STD_USING
- int scale1(0), scale2(0);
+ long long scale1(0), scale2(0);
M = boost::math::detail::hypergeometric_1F1_imp(a, b, z, pol, scale1);
M_next = boost::math::detail::hypergeometric_1F1_imp(T(a - 1), b, z, pol, scale2);
if (scale1 != scale2)
- M_next *= exp(scale2 - scale1);
+ M_next *= exp(T(scale2 - scale1));
if (M > 1e10f)
{
// rescale:
- int rescale = itrunc(log(fabs(M)));
+ long long rescale = lltrunc(log(fabs(M)));
M *= exp(T(-rescale));
M_next *= exp(T(-rescale));
scale1 += rescale;
return result;
}
- int scale()const { return scaling; }
+ long long scale()const { return scaling; }
private:
T term, b_minus_a_plus_n, M, M_next, a_, b_, z_;
- int n, k, scaling;
+ int n, k;
+ long long scaling;
};
template <class T, class Policy>
- T hypergeometric_1f1_recurrence_on_z_minus_zero(const T& a, const T& b, const T& z, int k, const Policy& pol, int& log_scaling)
+ T hypergeometric_1f1_recurrence_on_z_minus_zero(const T& a, const T& b, const T& z, int k, const Policy& pol, long long& log_scaling)
{
BOOST_MATH_STD_USING
- BOOST_ASSERT((z + k) / z > 0.5f);
+ BOOST_MATH_ASSERT((z + k) / z > 0.5f);
hypergeometric_1f1_recurrence_on_z_minus_zero_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
log_scaling += s.scale();
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
T hypergeometric_1f1_recurrence_on_z_plus_plus(const T& a, const T& b, const T& z, int k, const Policy& pol)
{
hypergeometric_1f1_recurrence_on_z_plus_plus_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
return result;
T hypergeometric_1f1_recurrence_on_z_zero_minus(const T& a, const T& b, const T& z, int k, const Policy& pol)
{
BOOST_MATH_STD_USING
- BOOST_ASSERT(abs(k) < fabs(z));
+ BOOST_MATH_ASSERT(abs(k) < fabs(z));
hypergeometric_1f1_recurrence_on_z_zero_minus_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
return result * pow((z + k) / z, 1 - b);
T hypergeometric_1f1_recurrence_on_z_plus_zero(const T& a, const T& b, const T& z, int k, const Policy& pol)
{
BOOST_MATH_STD_USING
- BOOST_ASSERT(k / z > -0.5f);
- //BOOST_ASSERT(floor(a) != a || a > 0);
+ BOOST_MATH_ASSERT(k / z > -0.5f);
+ //BOOST_MATH_ASSERT(floor(a) != a || a > 0);
hypergeometric_1f1_recurrence_on_z_plus_zero_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
return result * pow(z / (z + k), a);
{
BOOST_MATH_STD_USING
hypergeometric_1f1_recurrence_on_z_zero_plus_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
return result * exp(T(k));
{
BOOST_MATH_STD_USING
hypergeometric_1f1_recurrence_on_z_minus_minus_series<T, Policy> s(a, b, z, k, pol);
- boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
+ std::uintmax_t max_iter = boost::math::policies::get_max_series_iterations<Policy>();
T result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<T, Policy>(), max_iter);
boost::math::policies::check_series_iterations<T>("boost::math::hypergeometric_1f1_recurrence_on_z_plus_plus<%1%>(%1%,%1%,%1%)", max_iter, pol);
return result * exp(T(k)) * pow((z + k) / z, 1 - b);