diff options
Diffstat (limited to 'boost/math/special_functions/detail/bessel_yn.hpp')
-rw-r--r-- | boost/math/special_functions/detail/bessel_yn.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/boost/math/special_functions/detail/bessel_yn.hpp b/boost/math/special_functions/detail/bessel_yn.hpp index b4f9855a2f..0509062bbd 100644 --- a/boost/math/special_functions/detail/bessel_yn.hpp +++ b/boost/math/special_functions/detail/bessel_yn.hpp @@ -75,10 +75,11 @@ T bessel_yn(int n, T x, const Policy& pol) current = bessel_y1(x, pol); int k = 1; BOOST_ASSERT(k < n); + policies::check_series_iterations<T>("boost::math::bessel_y_n<%1%>(%1%,%1%)", n, pol); do { T fact = 2 * k / x; - if((tools::max_value<T>() - fabs(prev)) / fact < fabs(current)) + if((fact > 1) && ((tools::max_value<T>() - fabs(prev)) / fact < fabs(current))) { prev /= current; factor /= current; |