Skip to content

Commit

Permalink
Apply cyl_bessel_k0 logic change 113 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Dec 19, 2024
1 parent 0308556 commit 214e19c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/boost/math/special_functions/detail/bessel_k0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ BOOST_MATH_GPU_ENABLED T bessel_k0_imp(const T& x, const boost::math::integral_c
BOOST_MATH_BIG_CONSTANT(T, 113, 8.370574966987293592457152146806662562e+03),
BOOST_MATH_BIG_CONSTANT(T, 113, 4.871254714311063594080644835895740323e+01)
};
if(x < tools::log_max_value<T>())
if(-x > tools::log_min_value<T>())
return ((tools::evaluate_rational(P, Q, T(1 / x)) + Y) * exp(-x) / sqrt(x));
else
{
Expand Down
4 changes: 1 addition & 3 deletions reporting/performance/test_kn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ static const std::array<std::array<T, 3>, 9> kn_data = { {
{ { SC_(-10.0), SC_(1.0), SC_(1.80713289901029454691597861302340015908245782948536080022119e8) } },
{ { SC_(100.0), SC_(5.0), SC_(7.03986019306167654653386616796116726248616158936088056952477e115) } },
{ { SC_(100.0), SC_(80.0), SC_(8.39287107246490782848985384895907681748152272748337807033319e-12) } },
(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::min_exponent10 > -300))
? std::array<T, 3> { { SC_(-1000.0), SC_(660.0), SC_(5.231804195291135637493087823300645230085362374177628598848978) } }
: std::array<T, 3> { { SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) } },
{ { SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) } },
} };

int main()
Expand Down
4 changes: 1 addition & 3 deletions test/test_bessel_k.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ void test_bessel(T, const char* name)
{{ SC_(-10.0), SC_(1.0), SC_(1.80713289901029454691597861302340015908245782948536080022119e8) }},
{{ SC_(100.0), SC_(5.0), SC_(7.03986019306167654653386616796116726248616158936088056952477e115) }},
{{ SC_(100.0), SC_(80.0), SC_(8.39287107246490782848985384895907681748152272748337807033319e-12) }},
(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::min_exponent10 > -300))
? std::array<typename table_type<T>::type, 3> {{ SC_(-1000.0), SC_(660.0), SC_(5.231804195291135637493087823300645230085362374177628598848978) }}
: std::array<typename table_type<T>::type, 3> {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }},
{{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }},
}};
static const std::array<std::array<typename table_type<T>::type, 3>, 11> kv_data = {{
{{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }},
Expand Down

0 comments on commit 214e19c

Please sign in to comment.