From 978d10cacfabf38c1ba937df2049ec339287f653 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 4 Feb 2019 18:21:48 +0000 Subject: [PATCH] 1F1: Fixes for expression template enabled types. --- .../special_functions/detail/hypergeometric_1F1_large_abz.hpp | 2 +- include/boost/math/tools/recurrence.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp b/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp index 2c35f8a57..cb5c68018 100644 --- a/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp +++ b/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp @@ -51,7 +51,7 @@ gamma_cache[cache_size - 1] = boost::math::gamma_p(alpha_poch + (int)cache_size - 1, x, pol); for (int i = cache_size - 1; i > 0; --i) { - gamma_cache[i - 1] = gamma_cache[i] >= 1 ? 1 : gamma_cache[i] + regularised_gamma_prefix(alpha_poch + i - 1, x, pol, lanczos_type()) / (alpha_poch + i - 1); + gamma_cache[i - 1] = gamma_cache[i] >= 1 ? T(1) : T(gamma_cache[i] + regularised_gamma_prefix(T(alpha_poch + i - 1), x, pol, lanczos_type()) / (alpha_poch + i - 1)); } } T delta_poch, alpha_poch, x, term; diff --git a/include/boost/math/tools/recurrence.hpp b/include/boost/math/tools/recurrence.hpp index 59dc2aa98..ffbaf7a0e 100644 --- a/include/boost/math/tools/recurrence.hpp +++ b/include/boost/math/tools/recurrence.hpp @@ -226,7 +226,7 @@ namespace boost { : f_n(f_n), coef(r), k(0) { boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations >(); - f_n_minus_1 = f_n * boost::math::tools::function_ratio_from_forwards_recurrence(detail::recurrence_offsetter(r, -1), boost::math::tools::epsilon() * 2, max_iter); + f_n_minus_1 = f_n * boost::math::tools::function_ratio_from_forwards_recurrence(detail::recurrence_offsetter(r, -1), value_type(boost::math::tools::epsilon() * 2), max_iter); boost::math::policies::check_series_iterations("forward_recurrence_iterator<>::forward_recurrence_iterator", max_iter, boost::math::policies::policy<>()); } @@ -268,7 +268,7 @@ namespace boost { : f_n(f_n), coef(r), k(0) { boost::uintmax_t max_iter = boost::math::policies::get_max_series_iterations >(); - f_n_plus_1 = f_n * boost::math::tools::function_ratio_from_backwards_recurrence(detail::recurrence_offsetter(r, 1), boost::math::tools::epsilon() * 2, max_iter); + f_n_plus_1 = f_n * boost::math::tools::function_ratio_from_backwards_recurrence(detail::recurrence_offsetter(r, 1), value_type(boost::math::tools::epsilon() * 2), max_iter); boost::math::policies::check_series_iterations("backward_recurrence_iterator<>::backward_recurrence_iterator", max_iter, boost::math::policies::policy<>()); }