From 2a7bef3410c5b359e8c148d3c0739737185f2c49 Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Sun, 22 Dec 2024 14:43:19 +0100 Subject: [PATCH 1/4] Query cyl_bessel_k for cpp_double_double --- include/boost/math/tools/precision.hpp | 10 +++++++--- test/test_bessel_k.hpp | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/boost/math/tools/precision.hpp b/include/boost/math/tools/precision.hpp index 94c22b55ed..fac022f53a 100644 --- a/include/boost/math/tools/precision.hpp +++ b/include/boost/math/tools/precision.hpp @@ -182,9 +182,13 @@ struct log_limit_traits { typedef typename boost::math::conditional< (boost::math::numeric_limits::radix == 2) && - (boost::math::numeric_limits::max_exponent == 128 - || boost::math::numeric_limits::max_exponent == 1024 - || boost::math::numeric_limits::max_exponent == 16384), + ( + ( boost::math::numeric_limits::max_exponent == 128 + || boost::math::numeric_limits::max_exponent == 1024 + || boost::math::numeric_limits::max_exponent == 16384 + ) + && (-boost::math::numeric_limits::min_exponent + 1 == boost::math::numeric_limits::max_exponent) + ), boost::math::integral_constant::max_exponent > (boost::math::numeric_limits::max)() ? (boost::math::numeric_limits::max)() : static_cast(boost::math::numeric_limits::max_exponent))>, boost::math::integral_constant >::type tag_type; diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 6a2a8179d9..66e648b459 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -133,7 +133,9 @@ 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) }}, - {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }}, + ((std::numeric_limits::is_specialized) && (std::numeric_limits::min_exponent10 > -293)) + ? std::array::type, 3> {{ SC_(-1000.0), SC_(664.0), SC_(0.00372564418019942154373086796021082031912651177619335584767976) }} + : std::array::type, 3> {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }}, }}; static const std::array::type, 3>, 11> kv_data = {{ {{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }}, From 56aadecb629d3339d0d97082b71644f3ac908853 Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Mon, 23 Dec 2024 14:21:34 +0100 Subject: [PATCH 2/4] Repair typo in max_digits10 --- include/boost/math/tools/precision.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/math/tools/precision.hpp b/include/boost/math/tools/precision.hpp index fac022f53a..6e863401d9 100644 --- a/include/boost/math/tools/precision.hpp +++ b/include/boost/math/tools/precision.hpp @@ -187,7 +187,7 @@ struct log_limit_traits || boost::math::numeric_limits::max_exponent == 1024 || boost::math::numeric_limits::max_exponent == 16384 ) - && (-boost::math::numeric_limits::min_exponent + 1 == boost::math::numeric_limits::max_exponent) + && (-boost::math::numeric_limits::min_exponent10 + 1 == boost::math::numeric_limits::max_exponent10) ), boost::math::integral_constant::max_exponent > (boost::math::numeric_limits::max)() ? (boost::math::numeric_limits::max)() : static_cast(boost::math::numeric_limits::max_exponent))>, boost::math::integral_constant From 55a2181e8b57c8bf9d59ec38c45dfa01ec158747 Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Mon, 23 Dec 2024 18:51:41 +0100 Subject: [PATCH 3/4] Modify extreme test case from #1228 --- reporting/performance/test_kn.cpp | 2 +- test/test_bessel_k.hpp | 4 +--- test/test_bessel_k_prime.hpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/reporting/performance/test_kn.cpp b/reporting/performance/test_kn.cpp index bf2c8cda19..2f309f625e 100644 --- a/reporting/performance/test_kn.cpp +++ b/reporting/performance/test_kn.cpp @@ -48,7 +48,7 @@ static const std::array, 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) } }, - { { SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) } }, + { { SC_(-129.0), SC_(200.0), SC_(3.61744436315860678558682169223740584132967454950379795115566e-71) } }, } }; int main() diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 66e648b459..36b86bec5e 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -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::is_specialized) && (std::numeric_limits::min_exponent10 > -293)) - ? std::array::type, 3> {{ SC_(-1000.0), SC_(664.0), SC_(0.00372564418019942154373086796021082031912651177619335584767976) }} - : std::array::type, 3> {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }}, + {{ SC_(-129.0), SC_(200.0), SC_(3.61744436315860678558682169223740584132967454950379795115566e-71) }}, }}; static const std::array::type, 3>, 11> kv_data = {{ {{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }}, diff --git a/test/test_bessel_k_prime.hpp b/test/test_bessel_k_prime.hpp index f43728c118..8a344e422a 100644 --- a/test/test_bessel_k_prime.hpp +++ b/test/test_bessel_k_prime.hpp @@ -131,7 +131,7 @@ void test_bessel(T, const char* name) {{ SC_(-10.0), SC_(1.0), SC_(-1.8171379399979651461891429013401068319174853467388121e9) }}, {{ SC_(100.0), SC_(5.0), SC_(-1.4097486373570936520327835736048715219413065916411893e117) }}, {{ SC_(100.0), SC_(80.0), SC_(-1.34557011017664184003144916855685180771861680634827508e-11) }}, - {{ SC_(-1000.0), SC_(700.0), SC_(-1.136342773238774160870536985092768591616106526374957e-30) }}, + {{ SC_(-129.0), SC_(200.0), SC_(3.61744436315860678558682169223740584132967454950379795115566e-71) }}, }}; static const std::array, 11> kv_prime_data = {{ {{ SC_(0.5), SC_(0.875), SC_(-0.8776935068732421581818610624499915196588910540138553643355820) }}, From e24754779e337e1067de82e1a834d5c37d54c91f Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Mon, 23 Dec 2024 19:15:13 +0100 Subject: [PATCH 4/4] Repair typo in cyl_bessel_k_prime test --- test/test_bessel_k_prime.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_bessel_k_prime.hpp b/test/test_bessel_k_prime.hpp index 8a344e422a..79df46c703 100644 --- a/test/test_bessel_k_prime.hpp +++ b/test/test_bessel_k_prime.hpp @@ -131,7 +131,7 @@ void test_bessel(T, const char* name) {{ SC_(-10.0), SC_(1.0), SC_(-1.8171379399979651461891429013401068319174853467388121e9) }}, {{ SC_(100.0), SC_(5.0), SC_(-1.4097486373570936520327835736048715219413065916411893e117) }}, {{ SC_(100.0), SC_(80.0), SC_(-1.34557011017664184003144916855685180771861680634827508e-11) }}, - {{ SC_(-129.0), SC_(200.0), SC_(3.61744436315860678558682169223740584132967454950379795115566e-71) }}, + {{ SC_(-129.0), SC_(200.0), SC_(-4.3110345255133348027545113739271337415489367194240537230455182e-71) }}, }}; static const std::array, 11> kv_prime_data = {{ {{ SC_(0.5), SC_(0.875), SC_(-0.8776935068732421581818610624499915196588910540138553643355820) }},