From f29be8d4c9748e02c9a8a4362566e8ef4ef57e13 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 16 Aug 2024 17:39:37 +0700 Subject: [PATCH] correct fix --- .../boost/math/special_functions/detail/bessel_ik.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_ik.hpp b/include/boost/math/special_functions/detail/bessel_ik.hpp index a342ccf0c..badb70dee 100644 --- a/include/boost/math/special_functions/detail/bessel_ik.hpp +++ b/include/boost/math/special_functions/detail/bessel_ik.hpp @@ -327,6 +327,11 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) T scale = 1; T scale_sign = 1; + n = iround(v, pol); + u = v - n; // -1/2 <= u < 1/2 + BOOST_MATH_INSTRUMENT_VARIABLE(n); + BOOST_MATH_INSTRUMENT_VARIABLE(u); + if (((kind & need_i) == 0) && (fabs(4 * v * v - 25) / (8 * x) < tools::forth_root_epsilon())) { // A&S 9.7.2 @@ -338,11 +343,6 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) } else { - n = iround(v, pol); - u = v - n; // -1/2 <= u < 1/2 - BOOST_MATH_INSTRUMENT_VARIABLE(n); - BOOST_MATH_INSTRUMENT_VARIABLE(u); - BOOST_MATH_ASSERT(x > 0); // Error handling for x <= 0 handled in cyl_bessel_i and cyl_bessel_k // x is positive until reflection