From c35f12c1f51302b25d518ba9bc03cac247e1caad Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 1 Feb 2024 18:43:41 +0000 Subject: [PATCH 1/5] Update pre-computed constexpr Gauss and Gauss-Kronrod constants to always store literal types. Fixes: https://github.com/boostorg/math/issues/1077. --- include/boost/math/quadrature/gauss.hpp | 192 +++++++++--------- .../boost/math/quadrature/gauss_kronrod.hpp | 192 +++++++++--------- test/Jamfile.v2 | 1 + test/git_issue_1075.cpp | 42 ++++ 4 files changed, 235 insertions(+), 192 deletions(-) create mode 100644 test/git_issue_1075.cpp diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index 0e5bc0c787..b3a98e5f6d 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -79,9 +79,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 4.058451514e-01f, 7.415311856e-01f, @@ -89,9 +89,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 4.179591837e-01f, 3.818300505e-01f, 2.797053915e-01f, @@ -105,9 +105,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 4.05845151377397167e-01, 7.41531185599394440e-01, @@ -115,9 +115,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 4.17959183673469388e-01, 3.81830050505118945e-01, 2.79705391489276668e-01, @@ -131,9 +131,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 4.05845151377397166906606412076961463e-01L, 7.41531185599394439863864773280788407e-01L, @@ -141,9 +141,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 4.17959183673469387755102040816326531e-01L, 3.81830050505118944950369775488975134e-01L, 2.79705391489276667901467771423779582e-01L, @@ -157,9 +157,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 4> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 4> data = { 0.00000000000000000000000000000000000e+00Q, 4.05845151377397166906606412076961463e-01Q, 7.41531185599394439863864773280788407e-01Q, @@ -167,9 +167,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 4> const & weights() { - static const std::array data = { + static const std::array<__float128, 4> data = { 4.17959183673469387755102040816326531e-01Q, 3.81830050505118944950369775488975134e-01Q, 2.79705391489276667901467771423779582e-01Q, @@ -209,9 +209,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 1.488743390e-01f, 4.333953941e-01f, 6.794095683e-01f, @@ -220,9 +220,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.955242247e-01f, 2.692667193e-01f, 2.190863625e-01f, @@ -237,9 +237,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 1.48874338981631211e-01, 4.33395394129247191e-01, 6.79409568299024406e-01, @@ -248,9 +248,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.95524224714752870e-01, 2.69266719309996355e-01, 2.19086362515982044e-01, @@ -265,9 +265,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 1.48874338981631210884826001129719985e-01L, 4.33395394129247190799265943165784162e-01L, 6.79409568299024406234327365114873576e-01L, @@ -276,9 +276,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.95524224714752870173892994651338329e-01L, 2.69266719309996355091226921569469353e-01L, 2.19086362515982043995534934228163192e-01L, @@ -293,9 +293,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 5> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 5> data = { 1.48874338981631210884826001129719985e-01Q, 4.33395394129247190799265943165784162e-01Q, 6.79409568299024406234327365114873576e-01Q, @@ -304,9 +304,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 5> const & weights() { - static const std::array data = { + static const std::array<__float128, 5> data = { 2.95524224714752870173892994651338329e-01Q, 2.69266719309996355091226921569469353e-01Q, 2.19086362515982043995534934228163192e-01Q, @@ -349,9 +349,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 2.011940940e-01f, 3.941513471e-01f, @@ -363,9 +363,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.025782419e-01f, 1.984314853e-01f, 1.861610000e-01f, @@ -383,9 +383,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 2.01194093997434522e-01, 3.94151347077563370e-01, @@ -397,9 +397,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.02578241925561273e-01, 1.98431485327111576e-01, 1.86161000015562211e-01, @@ -417,9 +417,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 2.01194093997434522300628303394596208e-01L, 3.94151347077563369897207370981045468e-01L, @@ -431,9 +431,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.02578241925561272880620199967519315e-01L, 1.98431485327111576456118326443839325e-01L, 1.86161000015562211026800561866422825e-01L, @@ -451,9 +451,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 8> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 8> data = { 0.00000000000000000000000000000000000e+00Q, 2.01194093997434522300628303394596208e-01Q, 3.94151347077563369897207370981045468e-01Q, @@ -465,9 +465,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 8> const & weights() { - static const std::array data = { + static const std::array<__float128, 8> data = { 2.02578241925561272880620199967519315e-01Q, 1.98431485327111576456118326443839325e-01Q, 1.86161000015562211026800561866422825e-01Q, @@ -519,9 +519,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 7.652652113e-02f, 2.277858511e-01f, 3.737060887e-01f, @@ -535,9 +535,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.527533871e-01f, 1.491729865e-01f, 1.420961093e-01f, @@ -557,9 +557,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 7.65265211334973338e-02, 2.27785851141645078e-01, 3.73706088715419561e-01, @@ -573,9 +573,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.52753387130725851e-01, 1.49172986472603747e-01, 1.42096109318382051e-01, @@ -595,9 +595,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 7.65265211334973337546404093988382110e-02L, 2.27785851141645078080496195368574625e-01L, 3.73706088715419560672548177024927237e-01L, @@ -611,9 +611,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.52753387130725850698084331955097593e-01L, 1.49172986472603746787828737001969437e-01L, 1.42096109318382051329298325067164933e-01L, @@ -633,9 +633,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 10> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 10> data = { 7.65265211334973337546404093988382110e-02Q, 2.27785851141645078080496195368574625e-01Q, 3.73706088715419560672548177024927237e-01Q, @@ -649,9 +649,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 10> const & weights() { - static const std::array data = { + static const std::array<__float128, 10> data = { 1.52753387130725850698084331955097593e-01Q, 1.49172986472603746787828737001969437e-01Q, 1.42096109318382051329298325067164933e-01Q, @@ -709,9 +709,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 1.228646926e-01f, 2.438668837e-01f, @@ -728,9 +728,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.231760537e-01f, 1.222424430e-01f, 1.194557635e-01f, @@ -753,9 +753,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 1.22864692610710396e-01, 2.43866883720988432e-01, @@ -772,9 +772,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.23176053726715451e-01, 1.22242442990310042e-01, 1.19455763535784772e-01, @@ -797,9 +797,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 1.22864692610710396387359818808036806e-01L, 2.43866883720988432045190362797451586e-01L, @@ -816,9 +816,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.23176053726715451203902873079050142e-01L, 1.22242442990310041688959518945851506e-01L, 1.19455763535784772228178126512901047e-01L, @@ -841,9 +841,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 13> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 13> data = { 0.00000000000000000000000000000000000e+00Q, 1.22864692610710396387359818808036806e-01Q, 2.43866883720988432045190362797451586e-01Q, @@ -860,9 +860,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 13> const & weights() { - static const std::array data = { + static const std::array<__float128, 13> data = { 1.23176053726715451203902873079050142e-01Q, 1.22242442990310041688959518945851506e-01Q, 1.19455763535784772228178126512901047e-01Q, @@ -929,9 +929,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 5.147184256e-02f, 1.538699136e-01f, 2.546369262e-01f, @@ -950,9 +950,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.028526529e-01f, 1.017623897e-01f, 9.959342059e-02f, @@ -977,9 +977,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 5.14718425553176958e-02, 1.53869913608583547e-01, 2.54636926167889846e-01, @@ -998,9 +998,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.02852652893558840e-01, 1.01762389748405505e-01, 9.95934205867952671e-02, @@ -1025,9 +1025,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 5.14718425553176958330252131667225737e-02L, 1.53869913608583546963794672743255920e-01L, 2.54636926167889846439805129817805108e-01L, @@ -1046,9 +1046,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.02852652893558840341285636705415044e-01L, 1.01762389748405504596428952168554045e-01L, 9.95934205867952670627802821035694765e-02L, @@ -1073,9 +1073,9 @@ template class gauss_detail { public: - static std::array const & abscissa() + static std::array<__float128, 15> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 15> data = { 5.14718425553176958330252131667225737e-02Q, 1.53869913608583546963794672743255920e-01Q, 2.54636926167889846439805129817805108e-01Q, @@ -1094,9 +1094,9 @@ class gauss_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 15> const & weights() { - static const std::array data = { + static const std::array<__float128, 15> data = { 1.02852652893558840341285636705415044e-01Q, 1.01762389748405504596428952168554045e-01Q, 9.95934205867952670627802821035694765e-02Q, diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 63390db838..046fe8908a 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -86,9 +86,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 2.077849550e-01f, 4.058451514e-01f, @@ -100,9 +100,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.094821411e-01f, 2.044329401e-01f, 1.903505781e-01f, @@ -120,9 +120,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 2.07784955007898468e-01, 4.05845151377397167e-01, @@ -134,9 +134,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.09482141084727828e-01, 2.04432940075298892e-01, 1.90350578064785410e-01, @@ -154,9 +154,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 2.07784955007898467600689403773244913e-01L, 4.05845151377397166906606412076961463e-01L, @@ -168,9 +168,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 2.09482141084727828012999174891714264e-01L, 2.04432940075298892414161999234649085e-01L, 1.90350578064785409913256402421013683e-01L, @@ -189,9 +189,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 8> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 8> data = { 0.00000000000000000000000000000000000e+00Q, 2.07784955007898467600689403773244913e-01Q, 4.05845151377397166906606412076961463e-01Q, @@ -203,9 +203,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 8> const & weights() { - static const std::array data = { + static const std::array<__float128, 8> data = { 2.09482141084727828012999174891714264e-01Q, 2.04432940075298892414161999234649085e-01Q, 1.90350578064785409913256402421013683e-01Q, @@ -258,9 +258,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 1.488743390e-01f, 2.943928627e-01f, @@ -275,9 +275,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.494455540e-01f, 1.477391049e-01f, 1.427759386e-01f, @@ -298,9 +298,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 1.48874338981631211e-01, 2.94392862701460198e-01, @@ -315,9 +315,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.49445554002916906e-01, 1.47739104901338491e-01, 1.42775938577060081e-01, @@ -338,9 +338,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 1.48874338981631210884826001129719985e-01L, 2.94392862701460198131126603103865566e-01L, @@ -355,9 +355,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.49445554002916905664936468389821204e-01L, 1.47739104901338491374841515972068046e-01L, 1.42775938577060080797094273138717061e-01L, @@ -379,9 +379,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 11> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 11> data = { 0.00000000000000000000000000000000000e+00Q, 1.48874338981631210884826001129719985e-01Q, 2.94392862701460198131126603103865566e-01Q, @@ -396,9 +396,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 11> const & weights() { - static const std::array data = { + static const std::array<__float128, 11> data = { 1.49445554002916905664936468389821204e-01Q, 1.47739104901338491374841515972068046e-01Q, 1.42775938577060080797094273138717061e-01Q, @@ -460,9 +460,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 1.011420669e-01f, 2.011940940e-01f, @@ -482,9 +482,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.013300070e-01f, 1.007698455e-01f, 9.917359872e-02f, @@ -510,9 +510,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 1.01142066918717499e-01, 2.01194093997434522e-01, @@ -532,9 +532,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.01330007014791549e-01, 1.00769845523875595e-01, 9.91735987217919593e-02, @@ -560,9 +560,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 1.01142066918717499027074231447392339e-01L, 2.01194093997434522300628303394596208e-01L, @@ -582,9 +582,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 1.01330007014791549017374792767492547e-01L, 1.00769845523875595044946662617569722e-01L, 9.91735987217919593323931734846031311e-02L, @@ -611,9 +611,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 16> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 16> data = { 0.00000000000000000000000000000000000e+00Q, 1.01142066918717499027074231447392339e-01Q, 2.01194093997434522300628303394596208e-01Q, @@ -633,9 +633,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 16> const & weights() { - static const std::array data = { + static const std::array<__float128, 16> data = { 1.01330007014791549017374792767492547e-01Q, 1.00769845523875595044946662617569722e-01Q, 9.91735987217919593323931734846031311e-02Q, @@ -712,9 +712,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 7.652652113e-02f, 1.526054652e-01f, @@ -739,9 +739,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 7.660071192e-02f, 7.637786767e-02f, 7.570449768e-02f, @@ -772,9 +772,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 7.65265211334973338e-02, 1.52605465240922676e-01, @@ -799,9 +799,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 7.66007119179996564e-02, 7.63778676720807367e-02, 7.57044976845566747e-02, @@ -832,9 +832,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 7.65265211334973337546404093988382110e-02L, 1.52605465240922675505220241022677528e-01L, @@ -859,9 +859,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 7.66007119179996564450499015301017408e-02L, 7.63778676720807367055028350380610018e-02L, 7.57044976845566746595427753766165583e-02L, @@ -893,9 +893,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 21> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 21> data = { 0.00000000000000000000000000000000000e+00Q, 7.65265211334973337546404093988382110e-02Q, 1.52605465240922675505220241022677528e-01Q, @@ -920,9 +920,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 21> const & weights() { - static const std::array data = { + static const std::array<__float128, 21> data = { 7.66007119179996564450499015301017408e-02Q, 7.63778676720807367055028350380610018e-02Q, 7.57044976845566746595427753766165583e-02Q, @@ -1014,9 +1014,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 6.154448301e-02f, 1.228646926e-01f, @@ -1046,9 +1046,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 6.158081807e-02f, 6.147118987e-02f, 6.112850972e-02f, @@ -1084,9 +1084,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 6.15444830056850789e-02, 1.22864692610710396e-01, @@ -1116,9 +1116,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 6.15808180678329351e-02, 6.14711898714253167e-02, 6.11285097170530483e-02, @@ -1154,9 +1154,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 6.15444830056850788865463923667966313e-02L, 1.22864692610710396387359818808036806e-01L, @@ -1186,9 +1186,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 6.15808180678329350787598242400645532e-02L, 6.14711898714253166615441319652641776e-02L, 6.11285097170530483058590304162927119e-02L, @@ -1225,9 +1225,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 26> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 26> data = { 0.00000000000000000000000000000000000e+00Q, 6.15444830056850788865463923667966313e-02Q, 1.22864692610710396387359818808036806e-01Q, @@ -1257,9 +1257,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 26> const & weights() { - static const std::array data = { + static const std::array<__float128, 26> data = { 6.15808180678329350787598242400645532e-02Q, 6.14711898714253166615441319652641776e-02Q, 6.11285097170530483058590304162927119e-02Q, @@ -1366,9 +1366,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.000000000e+00f, 5.147184256e-02f, 1.028069380e-01f, @@ -1403,9 +1403,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 5.149472943e-02f, 5.142612854e-02f, 5.122154785e-02f, @@ -1446,9 +1446,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000e+00, 5.14718425553176958e-02, 1.02806937966737030e-01, @@ -1483,9 +1483,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 5.14947294294515676e-02, 5.14261285374590259e-02, 5.12215478492587722e-02, @@ -1526,9 +1526,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { + static constexpr std::array data = { 0.00000000000000000000000000000000000e+00L, 5.14718425553176958330252131667225737e-02L, 1.02806937966737030147096751318000592e-01L, @@ -1563,9 +1563,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { + static constexpr std::array data = { 5.14947294294515675583404336470993075e-02L, 5.14261285374590259338628792157812598e-02L, 5.12215478492587721706562826049442083e-02L, @@ -1607,9 +1607,9 @@ template class gauss_kronrod_detail { public: - static std::array const & abscissa() + static std::array<__float128, 31> const & abscissa() { - static const std::array data = { + static const std::array<__float128, 31> data = { 0.00000000000000000000000000000000000e+00Q, 5.14718425553176958330252131667225737e-02Q, 1.02806937966737030147096751318000592e-01Q, @@ -1644,9 +1644,9 @@ class gauss_kronrod_detail }; return data; } - static std::array const & weights() + static std::array<__float128, 31> const & weights() { - static const std::array data = { + static const std::array<__float128, 31> data = { 5.14947294294515675583404336470993075e-02Q, 5.14261285374590259338628792157812598e-02Q, 5.12215478492587721706562826049442083e-02Q, diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 532b875212..364c5ceef1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1486,6 +1486,7 @@ test-suite quadrature : [ compile compile_test/gauss_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ compile compile_test/gauss_kronrod_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run git_issue_898.cpp ] + [ run git_issue_1075.cpp : : : [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : "-Bstatic -lquadmath -Bdynamic" ] ] [ run test_trapezoidal.cpp ../../test/build//boost_unit_test_framework : : : release [ requires cxx11_lambdas cxx11_auto_declarations cxx11_decltype cxx11_unified_initialization_syntax cxx11_variadic_templates ] diff --git a/test/git_issue_1075.cpp b/test/git_issue_1075.cpp new file mode 100644 index 0000000000..192292084d --- /dev/null +++ b/test/git_issue_1075.cpp @@ -0,0 +1,42 @@ +// Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +template +auto f1(T t) { + return exp(-t * t / 2); +}; + +template +void test() +{ + T error = 0; + + auto r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + std::cout << r << std::endl; +} + + +int main() +{ + test(); + test(); + test(); + + return 0; +} From 87a905ab1aef917d64b1c911d885966a952a30a4 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 1 Feb 2024 19:10:52 +0000 Subject: [PATCH 2/5] Cast result of weights() calls to the correct type. --- include/boost/math/quadrature/gauss.hpp | 6 +++--- include/boost/math/quadrature/gauss_kronrod.hpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index b3a98e5f6d..d66cb37462 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -1185,7 +1185,7 @@ class gauss : public detail::gauss_detail(base::weights()[0]); } else { result = 0; @@ -1196,8 +1196,8 @@ class gauss : public detail::gauss_detail(base::weights()[i]); + L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); } if (pL1) *pL1 = L1; diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 046fe8908a..6def535dad 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -1787,13 +1787,13 @@ class gauss_kronrod : public detail::gauss_kronrod_detail::weights()[0]; + kronrod_result = fp * static_cast(base::weights()[0]); + gauss_result += fp * static_cast(gauss::weights()[0]); } else { fp = f(value_type(0)); - kronrod_result = fp * base::weights()[0]; + kronrod_result = fp * static_cast(base::weights()[0]); gauss_start = 1; kronrod_start = 2; } @@ -1802,16 +1802,16 @@ class gauss_kronrod : public detail::gauss_kronrod_detail::weights()[i / 2]; + kronrod_result += (fp + fm) * static_cast(base::weights()[i]); + L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); + gauss_result += (fp + fm) * static_cast(gauss::weights()[i / 2]); } for (unsigned i = kronrod_start; i < base::abscissa().size(); i += 2) { fp = f(base::abscissa()[i]); fm = f(-base::abscissa()[i]); - kronrod_result += (fp + fm) * base::weights()[i]; - L1 += (abs(fp) + abs(fm)) * base::weights()[i]; + kronrod_result += (fp + fm) * static_cast(base::weights()[i]); + L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); } if (pL1) *pL1 = L1; From b2b839ab4c26afe6d343c2f04c95da5ca34a160e Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 1 Feb 2024 20:05:58 +0000 Subject: [PATCH 3/5] Try and fix Mingw gcc-8 failures. --- test/git_issue_1075.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/git_issue_1075.cpp b/test/git_issue_1075.cpp index 192292084d..cf4cba0693 100644 --- a/test/git_issue_1075.cpp +++ b/test/git_issue_1075.cpp @@ -7,27 +7,24 @@ #include #include -template -auto f1(T t) { - return exp(-t * t / 2); -}; - template void test() { + auto f = [](const T& x){ return exp(-x * x / 2); }; + T error = 0; - auto r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + auto r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; - r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; - r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; - r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; - r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; - r = boost::math::quadrature::gauss_kronrod::integrate(&f1, 0, 1, 0, 0, &error); + r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; } From c5feae34bbdfedbe9ca5875eeb03dca8378c8a77 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 2 Feb 2024 18:48:57 +0000 Subject: [PATCH 4/5] Simplify tables of constants in gauss and gauss_kronrod code. Also mark up anything that uses BOOST_MATH_HUGE_CONSTANT as unreachable by code coverage as gcov seems to have an issue with it. --- include/boost/math/quadrature/gauss.hpp | 1096 ++++------ .../boost/math/quadrature/gauss_kronrod.hpp | 1805 ++++++----------- test/git_issue_1075.cpp | 2 +- 3 files changed, 933 insertions(+), 1970 deletions(-) diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index d66cb37462..e1a5f4bd61 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -29,14 +29,37 @@ struct gauss_constant_category (std::numeric_limits::is_specialized == 0) ? 999 : (std::numeric_limits::radix == 2) ? ( - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value ? 0 : - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value ? 1 : - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value ? 2 : #ifdef BOOST_HAS_FLOAT128 - (std::numeric_limits::digits <= 113) && std::is_constructible<__float128, T>::value ? 3 : + (std::numeric_limits::digits <= 113) && std::is_constructible<__float128, T>::value ? 0 : +#else + (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value ? 0 : #endif (std::numeric_limits::digits10 <= 110) ? 4 : 999 ) : (std::numeric_limits::digits10 <= 110) ? 4 : 999; + + using storage_type = + typename std::conditional<(std::numeric_limits::is_specialized == 0), T, + typename std::conditional<(std::numeric_limits::radix == 2), + typename std::conditional< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + float, + typename std::conditional<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + double, + typename std::conditional<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + long double, +#ifdef BOOST_HAS_FLOAT128 + typename std::conditional<((std::numeric_limits::digits <= 113) && std::is_constructible<__float128, T>::value), + __float128, + T + >::type + >::type +#else + T + >::type +#endif + >::type + >::type, T + >::type + >::type; }; #ifndef BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND @@ -74,106 +97,56 @@ template class gauss_detail; #endif - +#ifndef BOOST_HAS_FLOAT128 template class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 0.000000000e+00f, - 4.058451514e-01f, - 7.415311856e-01f, - 9.491079123e-01f, + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(4.05845151377397166906606412076961463e-01L), + static_cast(7.41531185599394439863864773280788407e-01L), + static_cast(9.49107912342758524526189684047851262e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 4.179591837e-01f, - 3.818300505e-01f, - 2.797053915e-01f, - 1.294849662e-01f, + static constexpr std::array data = { + static_cast(4.17959183673469387755102040816326531e-01L), + static_cast(3.81830050505118944950369775488975134e-01L), + static_cast(2.79705391489276667901467771423779582e-01L), + static_cast(1.29484966168869693270611432679082018e-01L), }; return data; } }; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 4.05845151377397167e-01, - 7.41531185599394440e-01, - 9.49107912342758525e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 4.17959183673469388e-01, - 3.81830050505118945e-01, - 2.79705391489276668e-01, - 1.29484966168869693e-01, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 4.05845151377397166906606412076961463e-01L, - 7.41531185599394439863864773280788407e-01L, - 9.49107912342758524526189684047851262e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 4.17959183673469387755102040816326531e-01L, - 3.81830050505118944950369775488975134e-01L, - 2.79705391489276667901467771423779582e-01L, - 1.29484966168869693270611432679082018e-01L, - }; - return data; - } -}; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 4> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 4> data = { - 0.00000000000000000000000000000000000e+00Q, - 4.05845151377397166906606412076961463e-01Q, - 7.41531185599394439863864773280788407e-01Q, - 9.49107912342758524526189684047851262e-01Q, + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(4.05845151377397166906606412076961463e-01Q), + static_cast(7.41531185599394439863864773280788407e-01Q), + static_cast(9.49107912342758524526189684047851262e-01Q), }; return data; } - static std::array<__float128, 4> const & weights() + static std::array const & weights() { - static const std::array<__float128, 4> data = { - 4.17959183673469387755102040816326531e-01Q, - 3.81830050505118944950369775488975134e-01Q, - 2.79705391489276667901467771423779582e-01Q, - 1.29484966168869693270611432679082018e-01Q, + static const std::array data = { + static_cast(4.17959183673469387755102040816326531e-01Q), + static_cast(3.81830050505118944950369775488975134e-01Q), + static_cast(2.79705391489276667901467771423779582e-01Q), + static_cast(1.29484966168869693270611432679082018e-01Q), }; return data; } @@ -185,133 +158,79 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 4.0584515137739716690660641207696146334738201409937012638704325179466381322612565532831268972774658776528675866604802e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.4153118559939443986386477328078840707414764714139026011995535196742987467218051379282683236686324705969251809311201e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.4910791234275852452618968404785126240077093767061778354876910391306333035484014080573077002792572414430073966699522e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 4.1795918367346938775510204081632653061224489795918367346938775510204081632653061224489795918367346938775510204081633e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.8183005050511894495036977548897513387836508353386273475108345103070554643412970834868465934404480145031467176458536e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.7970539148927666790146777142377958248692506522659876453701403269361881043056267681324094290119761876632337521337205e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.2948496616886969327061143267908201832858740225994666397720863872465523497204230871562541816292084508948440200163443e-01), - }; + }; // LCOV_EXCL_STOP return data; } }; - +#ifndef BOOST_HAS_FLOAT128 template class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 1.488743390e-01f, - 4.333953941e-01f, - 6.794095683e-01f, - 8.650633667e-01f, - 9.739065285e-01f, + static constexpr std::array data = { + static_cast(1.48874338981631210884826001129719985e-01L), + static_cast(4.33395394129247190799265943165784162e-01L), + static_cast(6.79409568299024406234327365114873576e-01L), + static_cast(8.65063366688984510732096688423493049e-01L), + static_cast(9.73906528517171720077964012084452053e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 2.955242247e-01f, - 2.692667193e-01f, - 2.190863625e-01f, - 1.494513492e-01f, - 6.667134431e-02f, + static constexpr std::array data = { + static_cast(2.95524224714752870173892994651338329e-01L), + static_cast(2.69266719309996355091226921569469353e-01L), + static_cast(2.19086362515982043995534934228163192e-01L), + static_cast(1.49451349150580593145776339657697332e-01L), + static_cast(6.66713443086881375935688098933317929e-02L), }; return data; } }; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 1.48874338981631211e-01, - 4.33395394129247191e-01, - 6.79409568299024406e-01, - 8.65063366688984511e-01, - 9.73906528517171720e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.95524224714752870e-01, - 2.69266719309996355e-01, - 2.19086362515982044e-01, - 1.49451349150580593e-01, - 6.66713443086881376e-02, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 1.48874338981631210884826001129719985e-01L, - 4.33395394129247190799265943165784162e-01L, - 6.79409568299024406234327365114873576e-01L, - 8.65063366688984510732096688423493049e-01L, - 9.73906528517171720077964012084452053e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.95524224714752870173892994651338329e-01L, - 2.69266719309996355091226921569469353e-01L, - 2.19086362515982043995534934228163192e-01L, - 1.49451349150580593145776339657697332e-01L, - 6.66713443086881375935688098933317929e-02L, - }; - return data; - } -}; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 5> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 5> data = { - 1.48874338981631210884826001129719985e-01Q, - 4.33395394129247190799265943165784162e-01Q, - 6.79409568299024406234327365114873576e-01Q, - 8.65063366688984510732096688423493049e-01Q, - 9.73906528517171720077964012084452053e-01Q, + static const std::array data = { + static_cast(1.48874338981631210884826001129719985e-01Q), + static_cast(4.33395394129247190799265943165784162e-01Q), + static_cast(6.79409568299024406234327365114873576e-01Q), + static_cast(8.65063366688984510732096688423493049e-01Q), + static_cast(9.73906528517171720077964012084452053e-01Q), }; return data; } - static std::array<__float128, 5> const & weights() + static std::array const & weights() { - static const std::array<__float128, 5> data = { - 2.95524224714752870173892994651338329e-01Q, - 2.69266719309996355091226921569469353e-01Q, - 2.19086362515982043995534934228163192e-01Q, - 1.49451349150580593145776339657697332e-01Q, - 6.66713443086881375935688098933317929e-02Q, + static const std::array data = { + static_cast(2.95524224714752870173892994651338329e-01Q), + static_cast(2.69266719309996355091226921569469353e-01Q), + static_cast(2.19086362515982043995534934228163192e-01Q), + static_cast(1.49451349150580593145776339657697332e-01Q), + static_cast(6.66713443086881375935688098933317929e-02Q), }; return data; } @@ -323,159 +242,94 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4887433898163121088482600112971998461756485942069169570798925351590361735566852137117762979946369123003116080525534e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 4.3339539412924719079926594316578416220007183765624649650270151314376698907770350122510275795011772122368293504099894e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.7940956829902440623432736511487357576929471183480946766481718895255857539507492461507857357048037949983390204739932e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 8.6506336668898451073209668842349304852754301496533045252195973184537475513805556135679072894604577069440463108641177e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.7390652851717172007796401208445205342826994669238211923121206669659520323463615962572356495626855625823304251877421e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 2.9552422471475287017389299465133832942104671702685360135430802975599593821715232927035659579375421672271716440125256e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.6926671930999635509122692156946935285975993846088379580056327624215343231917927676422663670925276075559581145036870e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.1908636251598204399553493422816319245877187052267708988095654363519991065295128124268399317720219278659121687281289e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4945134915058059314577633965769733240255663966942736783547726875323865472663001094594726463473195191400575256104544e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.6671344308688137593568809893331792857864834320158145128694881613412064084087101776785509685058877821090054714520419e-02), - }; + }; // LCOV_EXCL_STOP return data; } }; +#ifndef BOOST_HAS_FLOAT128 template class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 2.011940940e-01f, - 3.941513471e-01f, - 5.709721726e-01f, - 7.244177314e-01f, - 8.482065834e-01f, - 9.372733924e-01f, - 9.879925180e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.025782419e-01f, - 1.984314853e-01f, - 1.861610000e-01f, - 1.662692058e-01f, - 1.395706779e-01f, - 1.071592205e-01f, - 7.036604749e-02f, - 3.075324200e-02f, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 2.01194093997434522e-01, - 3.94151347077563370e-01, - 5.70972172608538848e-01, - 7.24417731360170047e-01, - 8.48206583410427216e-01, - 9.37273392400705904e-01, - 9.87992518020485428e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.02578241925561273e-01, - 1.98431485327111576e-01, - 1.86161000015562211e-01, - 1.66269205816993934e-01, - 1.39570677926154314e-01, - 1.07159220467171935e-01, - 7.03660474881081247e-02, - 3.07532419961172684e-02, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 2.01194093997434522300628303394596208e-01L, - 3.94151347077563369897207370981045468e-01L, - 5.70972172608538847537226737253910641e-01L, - 7.24417731360170047416186054613938010e-01L, - 8.48206583410427216200648320774216851e-01L, - 9.37273392400705904307758947710209471e-01L, - 9.87992518020485428489565718586612581e-01L, + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(2.01194093997434522300628303394596208e-01L), + static_cast(3.94151347077563369897207370981045468e-01L), + static_cast(5.70972172608538847537226737253910641e-01L), + static_cast(7.24417731360170047416186054613938010e-01L), + static_cast(8.48206583410427216200648320774216851e-01L), + static_cast(9.37273392400705904307758947710209471e-01L), + static_cast(9.87992518020485428489565718586612581e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 2.02578241925561272880620199967519315e-01L, - 1.98431485327111576456118326443839325e-01L, - 1.86161000015562211026800561866422825e-01L, - 1.66269205816993933553200860481208811e-01L, - 1.39570677926154314447804794511028323e-01L, - 1.07159220467171935011869546685869303e-01L, - 7.03660474881081247092674164506673385e-02L, - 3.07532419961172683546283935772044177e-02L, + static constexpr std::array data = { + static_cast(2.02578241925561272880620199967519315e-01L), + static_cast(1.98431485327111576456118326443839325e-01L), + static_cast(1.86161000015562211026800561866422825e-01L), + static_cast(1.66269205816993933553200860481208811e-01L), + static_cast(1.39570677926154314447804794511028323e-01L), + static_cast(1.07159220467171935011869546685869303e-01L), + static_cast(7.03660474881081247092674164506673385e-02L), + static_cast(3.07532419961172683546283935772044177e-02L), }; return data; } }; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 8> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 8> data = { - 0.00000000000000000000000000000000000e+00Q, - 2.01194093997434522300628303394596208e-01Q, - 3.94151347077563369897207370981045468e-01Q, - 5.70972172608538847537226737253910641e-01Q, - 7.24417731360170047416186054613938010e-01Q, - 8.48206583410427216200648320774216851e-01Q, - 9.37273392400705904307758947710209471e-01Q, - 9.87992518020485428489565718586612581e-01Q, + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(2.01194093997434522300628303394596208e-01Q), + static_cast(3.94151347077563369897207370981045468e-01Q), + static_cast(5.70972172608538847537226737253910641e-01Q), + static_cast(7.24417731360170047416186054613938010e-01Q), + static_cast(8.48206583410427216200648320774216851e-01Q), + static_cast(9.37273392400705904307758947710209471e-01Q), + static_cast(9.87992518020485428489565718586612581e-01Q), }; return data; } - static std::array<__float128, 8> const & weights() + static std::array const & weights() { - static const std::array<__float128, 8> data = { - 2.02578241925561272880620199967519315e-01Q, - 1.98431485327111576456118326443839325e-01Q, - 1.86161000015562211026800561866422825e-01Q, - 1.66269205816993933553200860481208811e-01Q, - 1.39570677926154314447804794511028323e-01Q, - 1.07159220467171935011869546685869303e-01Q, - 7.03660474881081247092674164506673385e-02Q, - 3.07532419961172683546283935772044177e-02Q, + static const std::array data = { + static_cast(2.02578241925561272880620199967519315e-01Q), + static_cast(1.98431485327111576456118326443839325e-01Q), + static_cast(1.86161000015562211026800561866422825e-01Q), + static_cast(1.66269205816993933553200860481208811e-01Q), + static_cast(1.39570677926154314447804794511028323e-01Q), + static_cast(1.07159220467171935011869546685869303e-01Q), + static_cast(7.03660474881081247092674164506673385e-02Q), + static_cast(3.07532419961172683546283935772044177e-02Q), }; return data; } @@ -487,7 +341,7 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0119409399743452230062830339459620781283645446263767961594972460994823900302018760183625806752105908967902257386509e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.9415134707756336989720737098104546836275277615869825503116534395160895778696141797549711416165976202589352169635648e-01), @@ -496,12 +350,12 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 8.4820658341042721620064832077421685136625617473699263409572755876067507517414548519760771975082148085090373835713340e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.3727339240070590430775894771020947124399627351530445790136307635020297379704552795054758617426808659746824044603157e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.8799251802048542848956571858661258114697281712376148999999751558738843736901942471272205036831914497667516843990079e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0257824192556127288062019996751931483866215800947735679670411605143539875474607409339344071278803213535148267082999e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.9843148532711157645611832644383932481869255995754199348473792792912479753343426813331499916481782320766020854889310e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.8616100001556221102680056186642282450622601227792840281549572731001325550269916061894976888609932360539977709001384e-01), @@ -510,158 +364,85 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0715922046717193501186954668586930341554371575810198068702238912187799485231579972568585713760862404439808767837506e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.0366047488108124709267416450667338466708032754330719825907292914387055512874237044840452066693939219355489858595041e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.0753241996117268354628393577204417721748144833434074264228285504237189467117168039038770732399404002516991188859473e-02), - }; + }; // LCOV_EXCL_STOP return data; } }; +#ifndef BOOST_HAS_FLOAT128 template class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 7.652652113e-02f, - 2.277858511e-01f, - 3.737060887e-01f, - 5.108670020e-01f, - 6.360536807e-01f, - 7.463319065e-01f, - 8.391169718e-01f, - 9.122344283e-01f, - 9.639719273e-01f, - 9.931285992e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.527533871e-01f, - 1.491729865e-01f, - 1.420961093e-01f, - 1.316886384e-01f, - 1.181945320e-01f, - 1.019301198e-01f, - 8.327674158e-02f, - 6.267204833e-02f, - 4.060142980e-02f, - 1.761400714e-02f, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 7.65265211334973338e-02, - 2.27785851141645078e-01, - 3.73706088715419561e-01, - 5.10867001950827098e-01, - 6.36053680726515025e-01, - 7.46331906460150793e-01, - 8.39116971822218823e-01, - 9.12234428251325906e-01, - 9.63971927277913791e-01, - 9.93128599185094925e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.52753387130725851e-01, - 1.49172986472603747e-01, - 1.42096109318382051e-01, - 1.31688638449176627e-01, - 1.18194531961518417e-01, - 1.01930119817240435e-01, - 8.32767415767047487e-02, - 6.26720483341090636e-02, - 4.06014298003869413e-02, - 1.76140071391521183e-02, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 7.65265211334973337546404093988382110e-02L, - 2.27785851141645078080496195368574625e-01L, - 3.73706088715419560672548177024927237e-01L, - 5.10867001950827098004364050955250998e-01L, - 6.36053680726515025452836696226285937e-01L, - 7.46331906460150792614305070355641590e-01L, - 8.39116971822218823394529061701520685e-01L, - 9.12234428251325905867752441203298113e-01L, - 9.63971927277913791267666131197277222e-01L, - 9.93128599185094924786122388471320278e-01L, + static constexpr std::array data = { + static_cast(7.65265211334973337546404093988382110e-02L), + static_cast(2.27785851141645078080496195368574625e-01L), + static_cast(3.73706088715419560672548177024927237e-01L), + static_cast(5.10867001950827098004364050955250998e-01L), + static_cast(6.36053680726515025452836696226285937e-01L), + static_cast(7.46331906460150792614305070355641590e-01L), + static_cast(8.39116971822218823394529061701520685e-01L), + static_cast(9.12234428251325905867752441203298113e-01L), + static_cast(9.63971927277913791267666131197277222e-01L), + static_cast(9.93128599185094924786122388471320278e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 1.52753387130725850698084331955097593e-01L, - 1.49172986472603746787828737001969437e-01L, - 1.42096109318382051329298325067164933e-01L, - 1.31688638449176626898494499748163135e-01L, - 1.18194531961518417312377377711382287e-01L, - 1.01930119817240435036750135480349876e-01L, - 8.32767415767047487247581432220462061e-02L, - 6.26720483341090635695065351870416064e-02L, - 4.06014298003869413310399522749321099e-02L, - 1.76140071391521183118619623518528164e-02L, + static constexpr std::array data = { + static_cast(1.52753387130725850698084331955097593e-01L), + static_cast(1.49172986472603746787828737001969437e-01L), + static_cast(1.42096109318382051329298325067164933e-01L), + static_cast(1.31688638449176626898494499748163135e-01L), + static_cast(1.18194531961518417312377377711382287e-01L), + static_cast(1.01930119817240435036750135480349876e-01L), + static_cast(8.32767415767047487247581432220462061e-02L), + static_cast(6.26720483341090635695065351870416064e-02L), + static_cast(4.06014298003869413310399522749321099e-02L), + static_cast(1.76140071391521183118619623518528164e-02L), }; return data; } }; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 10> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 10> data = { - 7.65265211334973337546404093988382110e-02Q, - 2.27785851141645078080496195368574625e-01Q, - 3.73706088715419560672548177024927237e-01Q, - 5.10867001950827098004364050955250998e-01Q, - 6.36053680726515025452836696226285937e-01Q, - 7.46331906460150792614305070355641590e-01Q, - 8.39116971822218823394529061701520685e-01Q, - 9.12234428251325905867752441203298113e-01Q, - 9.63971927277913791267666131197277222e-01Q, - 9.93128599185094924786122388471320278e-01Q, + static const std::array data = { + static_cast(7.65265211334973337546404093988382110e-02Q), + static_cast(2.27785851141645078080496195368574625e-01Q), + static_cast(3.73706088715419560672548177024927237e-01Q), + static_cast(5.10867001950827098004364050955250998e-01Q), + static_cast(6.36053680726515025452836696226285937e-01Q), + static_cast(7.46331906460150792614305070355641590e-01Q), + static_cast(8.39116971822218823394529061701520685e-01Q), + static_cast(9.12234428251325905867752441203298113e-01Q), + static_cast(9.63971927277913791267666131197277222e-01Q), + static_cast(9.93128599185094924786122388471320278e-01Q), }; return data; } - static std::array<__float128, 10> const & weights() + static std::array const & weights() { - static const std::array<__float128, 10> data = { - 1.52753387130725850698084331955097593e-01Q, - 1.49172986472603746787828737001969437e-01Q, - 1.42096109318382051329298325067164933e-01Q, - 1.31688638449176626898494499748163135e-01Q, - 1.18194531961518417312377377711382287e-01Q, - 1.01930119817240435036750135480349876e-01Q, - 8.32767415767047487247581432220462061e-02Q, - 6.26720483341090635695065351870416064e-02Q, - 4.06014298003869413310399522749321099e-02Q, - 1.76140071391521183118619623518528164e-02Q, + static const std::array data = { + static_cast(1.52753387130725850698084331955097593e-01Q), + static_cast(1.49172986472603746787828737001969437e-01Q), + static_cast(1.42096109318382051329298325067164933e-01Q), + static_cast(1.31688638449176626898494499748163135e-01Q), + static_cast(1.18194531961518417312377377711382287e-01Q), + static_cast(1.01930119817240435036750135480349876e-01Q), + static_cast(8.32767415767047487247581432220462061e-02Q), + static_cast(6.26720483341090635695065351870416064e-02Q), + static_cast(4.06014298003869413310399522749321099e-02Q), + static_cast(1.76140071391521183118619623518528164e-02Q), }; return data; } @@ -673,7 +454,7 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 7.6526521133497333754640409398838211004796266813497500804795244384256342048336978241545114181556215606998505646364133e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.2778585114164507808049619536857462474308893768292747231463573920717134186355582779495212519096870803177373131560430e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.7370608871541956067254817702492723739574632170568271182794861351564576437305952789589568363453337894476772208852815e-01), @@ -684,12 +465,12 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.1223442825132590586775244120329811304918479742369177479588221915807089120871907893644472619292138737876039175464603e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.6397192727791379126766613119727722191206032780618885606353759389204158078438305698001812525596471563131043491596423e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9312859918509492478612238847132027822264713090165589614818413121798471762775378083944940249657220927472894034724419e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.5275338713072585069808433195509759349194864511237859727470104981759745316273778153557248783650390593544001842813788e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4917298647260374678782873700196943669267990408136831649621121780984442259558678069396132603521048105170913854567338e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4209610931838205132929832506716493303451541339202030333736708298382808749793436761694922428320058260133068573666201e-01), @@ -700,182 +481,97 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 6.2672048334109063569506535187041606351601076578436364099584345437974811033665678644563766056832203512603253399592073e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 4.0601429800386941331039952274932109879090639989951536817606854561832296750987328295538920623044384976189825709675075e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.7614007139152118311861962351852816362143105543336732524349326677348419259621847817403105542146097668703716227512570e-02), - }; + }; // LCOV_EXCL_STOP return data; } }; +#ifndef BOOST_HAS_FLOAT128 template class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 1.228646926e-01f, - 2.438668837e-01f, - 3.611723058e-01f, - 4.730027314e-01f, - 5.776629302e-01f, - 6.735663685e-01f, - 7.592592630e-01f, - 8.334426288e-01f, - 8.949919979e-01f, - 9.429745712e-01f, - 9.766639215e-01f, - 9.955569698e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.231760537e-01f, - 1.222424430e-01f, - 1.194557635e-01f, - 1.148582591e-01f, - 1.085196245e-01f, - 1.005359491e-01f, - 9.102826198e-02f, - 8.014070034e-02f, - 6.803833381e-02f, - 5.490469598e-02f, - 4.093915670e-02f, - 2.635498662e-02f, - 1.139379850e-02f, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 1.22864692610710396e-01, - 2.43866883720988432e-01, - 3.61172305809387838e-01, - 4.73002731445714961e-01, - 5.77662930241222968e-01, - 6.73566368473468364e-01, - 7.59259263037357631e-01, - 8.33442628760834001e-01, - 8.94991997878275369e-01, - 9.42974571228974339e-01, - 9.76663921459517511e-01, - 9.95556969790498098e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.23176053726715451e-01, - 1.22242442990310042e-01, - 1.19455763535784772e-01, - 1.14858259145711648e-01, - 1.08519624474263653e-01, - 1.00535949067050644e-01, - 9.10282619829636498e-02, - 8.01407003350010180e-02, - 6.80383338123569172e-02, - 5.49046959758351919e-02, - 4.09391567013063127e-02, - 2.63549866150321373e-02, - 1.13937985010262879e-02, - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 1.22864692610710396387359818808036806e-01L, - 2.43866883720988432045190362797451586e-01L, - 3.61172305809387837735821730127640667e-01L, - 4.73002731445714960522182115009192041e-01L, - 5.77662930241222967723689841612654067e-01L, - 6.73566368473468364485120633247622176e-01L, - 7.59259263037357630577282865204360976e-01L, - 8.33442628760834001421021108693569569e-01L, - 8.94991997878275368851042006782804954e-01L, - 9.42974571228974339414011169658470532e-01L, - 9.76663921459517511498315386479594068e-01L, - 9.95556969790498097908784946893901617e-01L, + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(1.22864692610710396387359818808036806e-01L), + static_cast(2.43866883720988432045190362797451586e-01L), + static_cast(3.61172305809387837735821730127640667e-01L), + static_cast(4.73002731445714960522182115009192041e-01L), + static_cast(5.77662930241222967723689841612654067e-01L), + static_cast(6.73566368473468364485120633247622176e-01L), + static_cast(7.59259263037357630577282865204360976e-01L), + static_cast(8.33442628760834001421021108693569569e-01L), + static_cast(8.94991997878275368851042006782804954e-01L), + static_cast(9.42974571228974339414011169658470532e-01L), + static_cast(9.76663921459517511498315386479594068e-01L), + static_cast(9.95556969790498097908784946893901617e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 1.23176053726715451203902873079050142e-01L, - 1.22242442990310041688959518945851506e-01L, - 1.19455763535784772228178126512901047e-01L, - 1.14858259145711648339325545869555809e-01L, - 1.08519624474263653116093957050116619e-01L, - 1.00535949067050644202206890392685827e-01L, - 9.10282619829636498114972207028916534e-02L, - 8.01407003350010180132349596691113023e-02L, - 6.80383338123569172071871856567079686e-02L, - 5.49046959758351919259368915404733242e-02L, - 4.09391567013063126556234877116459537e-02L, - 2.63549866150321372619018152952991449e-02L, - 1.13937985010262879479029641132347736e-02L, + static constexpr std::array data = { + static_cast(1.23176053726715451203902873079050142e-01L), + static_cast(1.22242442990310041688959518945851506e-01L), + static_cast(1.19455763535784772228178126512901047e-01L), + static_cast(1.14858259145711648339325545869555809e-01L), + static_cast(1.08519624474263653116093957050116619e-01L), + static_cast(1.00535949067050644202206890392685827e-01L), + static_cast(9.10282619829636498114972207028916534e-02L), + static_cast(8.01407003350010180132349596691113023e-02L), + static_cast(6.80383338123569172071871856567079686e-02L), + static_cast(5.49046959758351919259368915404733242e-02L), + static_cast(4.09391567013063126556234877116459537e-02L), + static_cast(2.63549866150321372619018152952991449e-02L), + static_cast(1.13937985010262879479029641132347736e-02L), }; return data; } }; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 13> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 13> data = { - 0.00000000000000000000000000000000000e+00Q, - 1.22864692610710396387359818808036806e-01Q, - 2.43866883720988432045190362797451586e-01Q, - 3.61172305809387837735821730127640667e-01Q, - 4.73002731445714960522182115009192041e-01Q, - 5.77662930241222967723689841612654067e-01Q, - 6.73566368473468364485120633247622176e-01Q, - 7.59259263037357630577282865204360976e-01Q, - 8.33442628760834001421021108693569569e-01Q, - 8.94991997878275368851042006782804954e-01Q, - 9.42974571228974339414011169658470532e-01Q, - 9.76663921459517511498315386479594068e-01Q, - 9.95556969790498097908784946893901617e-01Q, + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(1.22864692610710396387359818808036806e-01Q), + static_cast(2.43866883720988432045190362797451586e-01Q), + static_cast(3.61172305809387837735821730127640667e-01Q), + static_cast(4.73002731445714960522182115009192041e-01Q), + static_cast(5.77662930241222967723689841612654067e-01Q), + static_cast(6.73566368473468364485120633247622176e-01Q), + static_cast(7.59259263037357630577282865204360976e-01Q), + static_cast(8.33442628760834001421021108693569569e-01Q), + static_cast(8.94991997878275368851042006782804954e-01Q), + static_cast(9.42974571228974339414011169658470532e-01Q), + static_cast(9.76663921459517511498315386479594068e-01Q), + static_cast(9.95556969790498097908784946893901617e-01Q), }; return data; } - static std::array<__float128, 13> const & weights() + static std::array const & weights() { - static const std::array<__float128, 13> data = { - 1.23176053726715451203902873079050142e-01Q, - 1.22242442990310041688959518945851506e-01Q, - 1.19455763535784772228178126512901047e-01Q, - 1.14858259145711648339325545869555809e-01Q, - 1.08519624474263653116093957050116619e-01Q, - 1.00535949067050644202206890392685827e-01Q, - 9.10282619829636498114972207028916534e-02Q, - 8.01407003350010180132349596691113023e-02Q, - 6.80383338123569172071871856567079686e-02Q, - 5.49046959758351919259368915404733242e-02Q, - 4.09391567013063126556234877116459537e-02Q, - 2.63549866150321372619018152952991449e-02Q, - 1.13937985010262879479029641132347736e-02Q, + static const std::array data = { + static_cast(1.23176053726715451203902873079050142e-01Q), + static_cast(1.22242442990310041688959518945851506e-01Q), + static_cast(1.19455763535784772228178126512901047e-01Q), + static_cast(1.14858259145711648339325545869555809e-01Q), + static_cast(1.08519624474263653116093957050116619e-01Q), + static_cast(1.00535949067050644202206890392685827e-01Q), + static_cast(9.10282619829636498114972207028916534e-02Q), + static_cast(8.01407003350010180132349596691113023e-02Q), + static_cast(6.80383338123569172071871856567079686e-02Q), + static_cast(5.49046959758351919259368915404733242e-02Q), + static_cast(4.09391567013063126556234877116459537e-02Q), + static_cast(2.63549866150321372619018152952991449e-02Q), + static_cast(1.13937985010262879479029641132347736e-02Q), }; return data; } @@ -887,7 +583,7 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.2286469261071039638735981880803680553220534604978373842389353789270883496885841582643884994633105537597765980412320e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.4386688372098843204519036279745158640563315632598447642113565325038747278585595067977636776325034060327548499765742e-01), @@ -901,12 +597,12 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.4297457122897433941401116965847053190520157060899014192745249713729532254404926130890521815127348327109666786665572e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.7666392145951751149831538647959406774537055531440674467098742731616386753588055389644670948300617866819865983054648e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9555696979049809790878494689390161725756264940480817121080493113293348134372793448728802635294700756868258870429256e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.2317605372671545120390287307905014243823362751815166539135219731691200794926142128460112517504958377310054583945994e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.2224244299031004168895951894585150583505924756305904090758008223203896721918010243033540891078906637115620156845304e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.1945576353578477222817812651290104739017670141372642551958788133518409022018773502442869720975271321374348568426235e-01), @@ -920,198 +616,106 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 4.0939156701306312655623487711645953660845783364104346504698414899297432880215512770478971055110424130123527015425511e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.6354986615032137261901815295299144935963281703322468755366165783870934008879499371529821528172928890350362464605104e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.1393798501026287947902964113234773603320526292909696448948061116189891729766743355923677112945033505688431618009664e-02), - }; - return data; - } -}; - -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 5.147184256e-02f, - 1.538699136e-01f, - 2.546369262e-01f, - 3.527047255e-01f, - 4.470337695e-01f, - 5.366241481e-01f, - 6.205261830e-01f, - 6.978504948e-01f, - 7.677774321e-01f, - 8.295657624e-01f, - 8.825605358e-01f, - 9.262000474e-01f, - 9.600218650e-01f, - 9.836681233e-01f, - 9.968934841e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.028526529e-01f, - 1.017623897e-01f, - 9.959342059e-02f, - 9.636873717e-02f, - 9.212252224e-02f, - 8.689978720e-02f, - 8.075589523e-02f, - 7.375597474e-02f, - 6.597422988e-02f, - 5.749315622e-02f, - 4.840267283e-02f, - 3.879919257e-02f, - 2.878470788e-02f, - 1.846646831e-02f, - 7.968192496e-03f, - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 5.14718425553176958e-02, - 1.53869913608583547e-01, - 2.54636926167889846e-01, - 3.52704725530878113e-01, - 4.47033769538089177e-01, - 5.36624148142019899e-01, - 6.20526182989242861e-01, - 6.97850494793315797e-01, - 7.67777432104826195e-01, - 8.29565762382768397e-01, - 8.82560535792052682e-01, - 9.26200047429274326e-01, - 9.60021864968307512e-01, - 9.83668123279747210e-01, - 9.96893484074649540e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.02852652893558840e-01, - 1.01762389748405505e-01, - 9.95934205867952671e-02, - 9.63687371746442596e-02, - 9.21225222377861287e-02, - 8.68997872010829798e-02, - 8.07558952294202154e-02, - 7.37559747377052063e-02, - 6.59742298821804951e-02, - 5.74931562176190665e-02, - 4.84026728305940529e-02, - 3.87991925696270496e-02, - 2.87847078833233693e-02, - 1.84664683110909591e-02, - 7.96819249616660562e-03, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() + static std::array const & abscissa() { - static constexpr std::array data = { - 5.14718425553176958330252131667225737e-02L, - 1.53869913608583546963794672743255920e-01L, - 2.54636926167889846439805129817805108e-01L, - 3.52704725530878113471037207089373861e-01L, - 4.47033769538089176780609900322854000e-01L, - 5.36624148142019899264169793311072794e-01L, - 6.20526182989242861140477556431189299e-01L, - 6.97850494793315796932292388026640068e-01L, - 7.67777432104826194917977340974503132e-01L, - 8.29565762382768397442898119732501916e-01L, - 8.82560535792052681543116462530225590e-01L, - 9.26200047429274325879324277080474004e-01L, - 9.60021864968307512216871025581797663e-01L, - 9.83668123279747209970032581605662802e-01L, - 9.96893484074649540271630050918695283e-01L, + static constexpr std::array data = { + static_cast(5.14718425553176958330252131667225737e-02L), + static_cast(1.53869913608583546963794672743255920e-01L), + static_cast(2.54636926167889846439805129817805108e-01L), + static_cast(3.52704725530878113471037207089373861e-01L), + static_cast(4.47033769538089176780609900322854000e-01L), + static_cast(5.36624148142019899264169793311072794e-01L), + static_cast(6.20526182989242861140477556431189299e-01L), + static_cast(6.97850494793315796932292388026640068e-01L), + static_cast(7.67777432104826194917977340974503132e-01L), + static_cast(8.29565762382768397442898119732501916e-01L), + static_cast(8.82560535792052681543116462530225590e-01L), + static_cast(9.26200047429274325879324277080474004e-01L), + static_cast(9.60021864968307512216871025581797663e-01L), + static_cast(9.83668123279747209970032581605662802e-01L), + static_cast(9.96893484074649540271630050918695283e-01L), }; return data; } - static std::array const & weights() + static std::array const & weights() { - static constexpr std::array data = { - 1.02852652893558840341285636705415044e-01L, - 1.01762389748405504596428952168554045e-01L, - 9.95934205867952670627802821035694765e-02L, - 9.63687371746442596394686263518098651e-02L, - 9.21225222377861287176327070876187672e-02L, - 8.68997872010829798023875307151257026e-02L, - 8.07558952294202153546949384605297309e-02L, - 7.37559747377052062682438500221907342e-02L, - 6.59742298821804951281285151159623612e-02L, - 5.74931562176190664817216894020561288e-02L, - 4.84026728305940529029381404228075178e-02L, - 3.87991925696270495968019364463476920e-02L, - 2.87847078833233693497191796112920436e-02L, - 1.84664683110909591423021319120472691e-02L, - 7.96819249616660561546588347467362245e-03L, + static constexpr std::array data = { + static_cast(1.02852652893558840341285636705415044e-01L), + static_cast(1.01762389748405504596428952168554045e-01L), + static_cast(9.95934205867952670627802821035694765e-02L), + static_cast(9.63687371746442596394686263518098651e-02L), + static_cast(9.21225222377861287176327070876187672e-02L), + static_cast(8.68997872010829798023875307151257026e-02L), + static_cast(8.07558952294202153546949384605297309e-02L), + static_cast(7.37559747377052062682438500221907342e-02L), + static_cast(6.59742298821804951281285151159623612e-02L), + static_cast(5.74931562176190664817216894020561288e-02L), + static_cast(4.84026728305940529029381404228075178e-02L), + static_cast(3.87991925696270495968019364463476920e-02L), + static_cast(2.87847078833233693497191796112920436e-02L), + static_cast(1.84664683110909591423021319120472691e-02L), + static_cast(7.96819249616660561546588347467362245e-03L), }; return data; } }; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_detail +class gauss_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 15> const & abscissa() + static std::array const & abscissa() { - static const std::array<__float128, 15> data = { - 5.14718425553176958330252131667225737e-02Q, - 1.53869913608583546963794672743255920e-01Q, - 2.54636926167889846439805129817805108e-01Q, - 3.52704725530878113471037207089373861e-01Q, - 4.47033769538089176780609900322854000e-01Q, - 5.36624148142019899264169793311072794e-01Q, - 6.20526182989242861140477556431189299e-01Q, - 6.97850494793315796932292388026640068e-01Q, - 7.67777432104826194917977340974503132e-01Q, - 8.29565762382768397442898119732501916e-01Q, - 8.82560535792052681543116462530225590e-01Q, - 9.26200047429274325879324277080474004e-01Q, - 9.60021864968307512216871025581797663e-01Q, - 9.83668123279747209970032581605662802e-01Q, - 9.96893484074649540271630050918695283e-01Q, + static const std::array data = { + static_cast(5.14718425553176958330252131667225737e-02Q), + static_cast(1.53869913608583546963794672743255920e-01Q), + static_cast(2.54636926167889846439805129817805108e-01Q), + static_cast(3.52704725530878113471037207089373861e-01Q), + static_cast(4.47033769538089176780609900322854000e-01Q), + static_cast(5.36624148142019899264169793311072794e-01Q), + static_cast(6.20526182989242861140477556431189299e-01Q), + static_cast(6.97850494793315796932292388026640068e-01Q), + static_cast(7.67777432104826194917977340974503132e-01Q), + static_cast(8.29565762382768397442898119732501916e-01Q), + static_cast(8.82560535792052681543116462530225590e-01Q), + static_cast(9.26200047429274325879324277080474004e-01Q), + static_cast(9.60021864968307512216871025581797663e-01Q), + static_cast(9.83668123279747209970032581605662802e-01Q), + static_cast(9.96893484074649540271630050918695283e-01Q), }; return data; } - static std::array<__float128, 15> const & weights() + static std::array const & weights() { - static const std::array<__float128, 15> data = { - 1.02852652893558840341285636705415044e-01Q, - 1.01762389748405504596428952168554045e-01Q, - 9.95934205867952670627802821035694765e-02Q, - 9.63687371746442596394686263518098651e-02Q, - 9.21225222377861287176327070876187672e-02Q, - 8.68997872010829798023875307151257026e-02Q, - 8.07558952294202153546949384605297309e-02Q, - 7.37559747377052062682438500221907342e-02Q, - 6.59742298821804951281285151159623612e-02Q, - 5.74931562176190664817216894020561288e-02Q, - 4.84026728305940529029381404228075178e-02Q, - 3.87991925696270495968019364463476920e-02Q, - 2.87847078833233693497191796112920436e-02Q, - 1.84664683110909591423021319120472691e-02Q, - 7.96819249616660561546588347467362245e-03Q, + static const std::array data = { + static_cast(1.02852652893558840341285636705415044e-01Q), + static_cast(1.01762389748405504596428952168554045e-01Q), + static_cast(9.95934205867952670627802821035694765e-02Q), + static_cast(9.63687371746442596394686263518098651e-02Q), + static_cast(9.21225222377861287176327070876187672e-02Q), + static_cast(8.68997872010829798023875307151257026e-02Q), + static_cast(8.07558952294202153546949384605297309e-02Q), + static_cast(7.37559747377052062682438500221907342e-02Q), + static_cast(6.59742298821804951281285151159623612e-02Q), + static_cast(5.74931562176190664817216894020561288e-02Q), + static_cast(4.84026728305940529029381404228075178e-02Q), + static_cast(3.87991925696270495968019364463476920e-02Q), + static_cast(2.87847078833233693497191796112920436e-02Q), + static_cast(1.84664683110909591423021319120472691e-02Q), + static_cast(7.96819249616660561546588347467362245e-03Q), }; return data; } @@ -1123,7 +727,7 @@ class gauss_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 5.1471842555317695833025213166722573749141453666569564255160843987964755210427109055870090707285485841217089963590678e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.5386991360858354696379467274325592041855197124433846171896298291578714851081610139692310651074078557990111754952062e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.5463692616788984643980512981780510788278930330251842616428597508896353156907880290636628138423620257595521678255758e-01), @@ -1139,12 +743,12 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.6002186496830751221687102558179766293035921740392339948566167242493995770706842922718944370380002378239172677454384e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.8366812327974720997003258160566280194031785470971136351718001015114429536479104370207597166035471368057762560137209e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9689348407464954027163005091869528334088203811775079010809429780238769521016374081588201955806171741257405095963817e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0285265289355884034128563670541504386837555706492822258631898667601623865660942939262884632188870916503815852709086e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0176238974840550459642895216855404463270628948712684086426094541964251360531767494547599781978391198881693385887696e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9593420586795267062780282103569476529869263666704277221365146183946660389908809018092299289324184705373523229592037e-02), @@ -1160,7 +764,7 @@ class gauss_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 2.8784707883323369349719179611292043639588894546287496474180122608145988940013933101730206711484171554940392262251283e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.8466468311090959142302131912047269096206533968181403371298365514585599521307973654080519029675417955638095832046164e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.9681924961666056154658834746736224504806965871517212294851633569200384329013332941536616922861735209846506562158817e-03), - }; + }; // LCOV_EXCL_STOP return data; } }; diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 6def535dad..9604d29e82 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -82,138 +82,73 @@ class gauss_kronrod_detail; #endif +#ifndef BOOST_HAS_FLOAT128 template class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 2.077849550e-01f, - 4.058451514e-01f, - 5.860872355e-01f, - 7.415311856e-01f, - 8.648644234e-01f, - 9.491079123e-01f, - 9.914553711e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.094821411e-01f, - 2.044329401e-01f, - 1.903505781e-01f, - 1.690047266e-01f, - 1.406532597e-01f, - 1.047900103e-01f, - 6.309209263e-02f, - 2.293532201e-02f, - }; - return data; - } -}; - -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 2.07784955007898468e-01, - 4.05845151377397167e-01, - 5.86087235467691130e-01, - 7.41531185599394440e-01, - 8.64864423359769073e-01, - 9.49107912342758525e-01, - 9.91455371120812639e-01, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(2.07784955007898467600689403773244913e-01L), + static_cast(4.05845151377397166906606412076961463e-01L), + static_cast(5.86087235467691130294144838258729598e-01L), + static_cast(7.41531185599394439863864773280788407e-01L), + static_cast(8.64864423359769072789712788640926201e-01L), + static_cast(9.49107912342758524526189684047851262e-01L), + static_cast(9.91455371120812639206854697526328517e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 2.09482141084727828e-01, - 2.04432940075298892e-01, - 1.90350578064785410e-01, - 1.69004726639267903e-01, - 1.40653259715525919e-01, - 1.04790010322250184e-01, - 6.30920926299785533e-02, - 2.29353220105292250e-02, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(2.09482141084727828012999174891714264e-01L), + static_cast(2.04432940075298892414161999234649085e-01L), + static_cast(1.90350578064785409913256402421013683e-01L), + static_cast(1.69004726639267902826583426598550284e-01L), + static_cast(1.40653259715525918745189590510237920e-01L), + static_cast(1.04790010322250183839876322541518017e-01L), + static_cast(6.30920926299785532907006631892042867e-02L), + static_cast(2.29353220105292249637320080589695920e-02L), }; return data; } }; +#else template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 2.07784955007898467600689403773244913e-01L, - 4.05845151377397166906606412076961463e-01L, - 5.86087235467691130294144838258729598e-01L, - 7.41531185599394439863864773280788407e-01L, - 8.64864423359769072789712788640926201e-01L, - 9.49107912342758524526189684047851262e-01L, - 9.91455371120812639206854697526328517e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 2.09482141084727828012999174891714264e-01L, - 2.04432940075298892414161999234649085e-01L, - 1.90350578064785409913256402421013683e-01L, - 1.69004726639267902826583426598550284e-01L, - 1.40653259715525918745189590510237920e-01L, - 1.04790010322250183839876322541518017e-01L, - 6.30920926299785532907006631892042867e-02L, - 2.29353220105292249637320080589695920e-02L, - }; - return data; - } -}; - -#ifdef BOOST_HAS_FLOAT128 -template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 8> const & abscissa() - { - static const std::array<__float128, 8> data = { - 0.00000000000000000000000000000000000e+00Q, - 2.07784955007898467600689403773244913e-01Q, - 4.05845151377397166906606412076961463e-01Q, - 5.86087235467691130294144838258729598e-01Q, - 7.41531185599394439863864773280788407e-01Q, - 8.64864423359769072789712788640926201e-01Q, - 9.49107912342758524526189684047851262e-01Q, - 9.91455371120812639206854697526328517e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(2.07784955007898467600689403773244913e-01Q), + static_cast(4.05845151377397166906606412076961463e-01Q), + static_cast(5.86087235467691130294144838258729598e-01Q), + static_cast(7.41531185599394439863864773280788407e-01Q), + static_cast(8.64864423359769072789712788640926201e-01Q), + static_cast(9.49107912342758524526189684047851262e-01Q), + static_cast(9.91455371120812639206854697526328517e-01Q), }; return data; } - static std::array<__float128, 8> const & weights() - { - static const std::array<__float128, 8> data = { - 2.09482141084727828012999174891714264e-01Q, - 2.04432940075298892414161999234649085e-01Q, - 1.90350578064785409913256402421013683e-01Q, - 1.69004726639267902826583426598550284e-01Q, - 1.40653259715525918745189590510237920e-01Q, - 1.04790010322250183839876322541518017e-01Q, - 6.30920926299785532907006631892042867e-02Q, - 2.29353220105292249637320080589695920e-02Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(2.09482141084727828012999174891714264e-01Q), + static_cast(2.04432940075298892414161999234649085e-01Q), + static_cast(1.90350578064785409913256402421013683e-01Q), + static_cast(1.69004726639267902826583426598550284e-01Q), + static_cast(1.40653259715525918745189590510237920e-01Q), + static_cast(1.04790010322250183839876322541518017e-01Q), + static_cast(6.30920926299785532907006631892042867e-02Q), + static_cast(2.29353220105292249637320080589695920e-02Q), }; return data; } @@ -226,7 +161,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0778495500789846760068940377324491347978440714517064971384573461986693844943520226910343227183698530560857645062738e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 4.0584515137739716690660641207696146334738201409937012638704325179466381322612565532831268972774658776528675866604802e-01), @@ -235,12 +170,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 8.6486442335976907278971278864092620121097230707408814860145771276706770813259572103585847859604590541475281326027862e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.4910791234275852452618968404785126240077093767061778354876910391306333035484014080573077002792572414430073966699522e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9145537112081263920685469752632851664204433837033470129108741357244173934653407235924503509626841760744349505339308e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0948214108472782801299917489171426369776208022370431671299800656137515132325648616816908211675949102392971459688215e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0443294007529889241416199923464908471651760418071835742447095312045467698546598879348374292009347554167803659293064e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.9035057806478540991325640242101368282607807545535835588544088036744058072410212679605964605106377593834568683551139e-01), @@ -249,167 +184,91 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0479001032225018383987632254151801744375665421383061189339065133963746321576289524167571627509311333949422518201492e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.3092092629978553290700663189204286665071157211550707113605545146983997477964874928199170264504441995865872491871943e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.2935322010529224963732008058969591993560811275746992267507430254711815787976075946156368168156289483493617134063245e-02), - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 1.488743390e-01f, - 2.943928627e-01f, - 4.333953941e-01f, - 5.627571347e-01f, - 6.794095683e-01f, - 7.808177266e-01f, - 8.650633667e-01f, - 9.301574914e-01f, - 9.739065285e-01f, - 9.956571630e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.494455540e-01f, - 1.477391049e-01f, - 1.427759386e-01f, - 1.347092173e-01f, - 1.234919763e-01f, - 1.093871588e-01f, - 9.312545458e-02f, - 7.503967481e-02f, - 5.475589657e-02f, - 3.255816231e-02f, - 1.169463887e-02f, - }; - return data; - } -}; - -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 1.48874338981631211e-01, - 2.94392862701460198e-01, - 4.33395394129247191e-01, - 5.62757134668604683e-01, - 6.79409568299024406e-01, - 7.80817726586416897e-01, - 8.65063366688984511e-01, - 9.30157491355708226e-01, - 9.73906528517171720e-01, - 9.95657163025808081e-01, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.49445554002916906e-01, - 1.47739104901338491e-01, - 1.42775938577060081e-01, - 1.34709217311473326e-01, - 1.23491976262065851e-01, - 1.09387158802297642e-01, - 9.31254545836976055e-02, - 7.50396748109199528e-02, - 5.47558965743519960e-02, - 3.25581623079647275e-02, - 1.16946388673718743e-02, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 1.48874338981631210884826001129719985e-01L, - 2.94392862701460198131126603103865566e-01L, - 4.33395394129247190799265943165784162e-01L, - 5.62757134668604683339000099272694141e-01L, - 6.79409568299024406234327365114873576e-01L, - 7.80817726586416897063717578345042377e-01L, - 8.65063366688984510732096688423493049e-01L, - 9.30157491355708226001207180059508346e-01L, - 9.73906528517171720077964012084452053e-01L, - 9.95657163025808080735527280689002848e-01L, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(1.48874338981631210884826001129719985e-01L), + static_cast(2.94392862701460198131126603103865566e-01L), + static_cast(4.33395394129247190799265943165784162e-01L), + static_cast(5.62757134668604683339000099272694141e-01L), + static_cast(6.79409568299024406234327365114873576e-01L), + static_cast(7.80817726586416897063717578345042377e-01L), + static_cast(8.65063366688984510732096688423493049e-01L), + static_cast(9.30157491355708226001207180059508346e-01L), + static_cast(9.73906528517171720077964012084452053e-01L), + static_cast(9.95657163025808080735527280689002848e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 1.49445554002916905664936468389821204e-01L, - 1.47739104901338491374841515972068046e-01L, - 1.42775938577060080797094273138717061e-01L, - 1.34709217311473325928054001771706833e-01L, - 1.23491976262065851077958109831074160e-01L, - 1.09387158802297641899210590325804960e-01L, - 9.31254545836976055350654650833663444e-02L, - 7.50396748109199527670431409161900094e-02L, - 5.47558965743519960313813002445801764e-02L, - 3.25581623079647274788189724593897606e-02L, - 1.16946388673718742780643960621920484e-02L, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(1.49445554002916905664936468389821204e-01L), + static_cast(1.47739104901338491374841515972068046e-01L), + static_cast(1.42775938577060080797094273138717061e-01L), + static_cast(1.34709217311473325928054001771706833e-01L), + static_cast(1.23491976262065851077958109831074160e-01L), + static_cast(1.09387158802297641899210590325804960e-01L), + static_cast(9.31254545836976055350654650833663444e-02L), + static_cast(7.50396748109199527670431409161900094e-02L), + static_cast(5.47558965743519960313813002445801764e-02L), + static_cast(3.25581623079647274788189724593897606e-02L), + static_cast(1.16946388673718742780643960621920484e-02L), }; return data; } }; -#ifdef BOOST_HAS_FLOAT128 +#else template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 11> const & abscissa() - { - static const std::array<__float128, 11> data = { - 0.00000000000000000000000000000000000e+00Q, - 1.48874338981631210884826001129719985e-01Q, - 2.94392862701460198131126603103865566e-01Q, - 4.33395394129247190799265943165784162e-01Q, - 5.62757134668604683339000099272694141e-01Q, - 6.79409568299024406234327365114873576e-01Q, - 7.80817726586416897063717578345042377e-01Q, - 8.65063366688984510732096688423493049e-01Q, - 9.30157491355708226001207180059508346e-01Q, - 9.73906528517171720077964012084452053e-01Q, - 9.95657163025808080735527280689002848e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(1.48874338981631210884826001129719985e-01Q), + static_cast(2.94392862701460198131126603103865566e-01Q), + static_cast(4.33395394129247190799265943165784162e-01Q), + static_cast(5.62757134668604683339000099272694141e-01Q), + static_cast(6.79409568299024406234327365114873576e-01Q), + static_cast(7.80817726586416897063717578345042377e-01Q), + static_cast(8.65063366688984510732096688423493049e-01Q), + static_cast(9.30157491355708226001207180059508346e-01Q), + static_cast(9.73906528517171720077964012084452053e-01Q), + static_cast(9.95657163025808080735527280689002848e-01Q), }; return data; } - static std::array<__float128, 11> const & weights() - { - static const std::array<__float128, 11> data = { - 1.49445554002916905664936468389821204e-01Q, - 1.47739104901338491374841515972068046e-01Q, - 1.42775938577060080797094273138717061e-01Q, - 1.34709217311473325928054001771706833e-01Q, - 1.23491976262065851077958109831074160e-01Q, - 1.09387158802297641899210590325804960e-01Q, - 9.31254545836976055350654650833663444e-02Q, - 7.50396748109199527670431409161900094e-02Q, - 5.47558965743519960313813002445801764e-02Q, - 3.25581623079647274788189724593897606e-02Q, - 1.16946388673718742780643960621920484e-02Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(1.49445554002916905664936468389821204e-01Q), + static_cast(1.47739104901338491374841515972068046e-01Q), + static_cast(1.42775938577060080797094273138717061e-01Q), + static_cast(1.34709217311473325928054001771706833e-01Q), + static_cast(1.23491976262065851077958109831074160e-01Q), + static_cast(1.09387158802297641899210590325804960e-01Q), + static_cast(9.31254545836976055350654650833663444e-02Q), + static_cast(7.50396748109199527670431409161900094e-02Q), + static_cast(5.47558965743519960313813002445801764e-02Q), + static_cast(3.25581623079647274788189724593897606e-02Q), + static_cast(1.16946388673718742780643960621920484e-02Q), }; return data; } @@ -422,7 +281,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4887433898163121088482600112971998461756485942069169570798925351590361735566852137117762979946369123003116080525534e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.9439286270146019813112660310386556616268662515695791864888229172724611166332737888445523178268237359119185139299872e-01), @@ -434,12 +293,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.3015749135570822600120718005950834622516790998193924230349406866828415983091673055011194572851007884702013619684320e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.7390652851717172007796401208445205342826994669238211923121206669659520323463615962572356495626855625823304251877421e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9565716302580808073552728068900284792126058721947892436337916111757023046774867357152325996912076724298149077812671e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4944555400291690566493646838982120374523631668747280383560851873698964478511841925721030705689540264726493367634340e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4773910490133849137484151597206804552373162548520660451819195439885993016735696405732703959182882254268727823258502e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4277593857706008079709427313871706088597905653190555560741004743970770449909340027811131706283756428281146832304737e-01), @@ -451,207 +310,112 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 5.4755896574351996031381300244580176373721114058333557524432615804784098927818975325116301569003298086458722055550981e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.2558162307964727478818972459389760617388939845662609571537504232714121820165498692381607605384626494546068817765276e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.1694638867371874278064396062192048396217332481931888927598147525622222058064992651806736704969967250888097490233242e-02), - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 1.011420669e-01f, - 2.011940940e-01f, - 2.991800072e-01f, - 3.941513471e-01f, - 4.850818636e-01f, - 5.709721726e-01f, - 6.509967413e-01f, - 7.244177314e-01f, - 7.904185014e-01f, - 8.482065834e-01f, - 8.972645323e-01f, - 9.372733924e-01f, - 9.677390757e-01f, - 9.879925180e-01f, - 9.980022987e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.013300070e-01f, - 1.007698455e-01f, - 9.917359872e-02f, - 9.664272698e-02f, - 9.312659817e-02f, - 8.856444306e-02f, - 8.308050282e-02f, - 7.684968076e-02f, - 6.985412132e-02f, - 6.200956780e-02f, - 5.348152469e-02f, - 4.458975132e-02f, - 3.534636079e-02f, - 2.546084733e-02f, - 1.500794733e-02f, - 5.377479873e-03f, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 1.01142066918717499e-01, - 2.01194093997434522e-01, - 2.99180007153168812e-01, - 3.94151347077563370e-01, - 4.85081863640239681e-01, - 5.70972172608538848e-01, - 6.50996741297416971e-01, - 7.24417731360170047e-01, - 7.90418501442465933e-01, - 8.48206583410427216e-01, - 8.97264532344081901e-01, - 9.37273392400705904e-01, - 9.67739075679139134e-01, - 9.87992518020485428e-01, - 9.98002298693397060e-01, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(1.01142066918717499027074231447392339e-01L), + static_cast(2.01194093997434522300628303394596208e-01L), + static_cast(2.99180007153168812166780024266388963e-01L), + static_cast(3.94151347077563369897207370981045468e-01L), + static_cast(4.85081863640239680693655740232350613e-01L), + static_cast(5.70972172608538847537226737253910641e-01L), + static_cast(6.50996741297416970533735895313274693e-01L), + static_cast(7.24417731360170047416186054613938010e-01L), + static_cast(7.90418501442465932967649294817947347e-01L), + static_cast(8.48206583410427216200648320774216851e-01L), + static_cast(8.97264532344081900882509656454495883e-01L), + static_cast(9.37273392400705904307758947710209471e-01L), + static_cast(9.67739075679139134257347978784337225e-01L), + static_cast(9.87992518020485428489565718586612581e-01L), + static_cast(9.98002298693397060285172840152271209e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 1.01330007014791549e-01, - 1.00769845523875595e-01, - 9.91735987217919593e-02, - 9.66427269836236785e-02, - 9.31265981708253212e-02, - 8.85644430562117706e-02, - 8.30805028231330210e-02, - 7.68496807577203789e-02, - 6.98541213187282587e-02, - 6.20095678006706403e-02, - 5.34815246909280873e-02, - 4.45897513247648766e-02, - 3.53463607913758462e-02, - 2.54608473267153202e-02, - 1.50079473293161225e-02, - 5.37747987292334899e-03, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(1.01330007014791549017374792767492547e-01L), + static_cast(1.00769845523875595044946662617569722e-01L), + static_cast(9.91735987217919593323931734846031311e-02L), + static_cast(9.66427269836236785051799076275893351e-02L), + static_cast(9.31265981708253212254868727473457186e-02L), + static_cast(8.85644430562117706472754436937743032e-02L), + static_cast(8.30805028231330210382892472861037896e-02L), + static_cast(7.68496807577203788944327774826590067e-02L), + static_cast(6.98541213187282587095200770991474758e-02L), + static_cast(6.20095678006706402851392309608029322e-02L), + static_cast(5.34815246909280872653431472394302968e-02L), + static_cast(4.45897513247648766082272993732796902e-02L), + static_cast(3.53463607913758462220379484783600481e-02L), + static_cast(2.54608473267153201868740010196533594e-02L), + static_cast(1.50079473293161225383747630758072681e-02L), + static_cast(5.37747987292334898779205143012764982e-03L), }; return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 1.01142066918717499027074231447392339e-01L, - 2.01194093997434522300628303394596208e-01L, - 2.99180007153168812166780024266388963e-01L, - 3.94151347077563369897207370981045468e-01L, - 4.85081863640239680693655740232350613e-01L, - 5.70972172608538847537226737253910641e-01L, - 6.50996741297416970533735895313274693e-01L, - 7.24417731360170047416186054613938010e-01L, - 7.90418501442465932967649294817947347e-01L, - 8.48206583410427216200648320774216851e-01L, - 8.97264532344081900882509656454495883e-01L, - 9.37273392400705904307758947710209471e-01L, - 9.67739075679139134257347978784337225e-01L, - 9.87992518020485428489565718586612581e-01L, - 9.98002298693397060285172840152271209e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 1.01330007014791549017374792767492547e-01L, - 1.00769845523875595044946662617569722e-01L, - 9.91735987217919593323931734846031311e-02L, - 9.66427269836236785051799076275893351e-02L, - 9.31265981708253212254868727473457186e-02L, - 8.85644430562117706472754436937743032e-02L, - 8.30805028231330210382892472861037896e-02L, - 7.68496807577203788944327774826590067e-02L, - 6.98541213187282587095200770991474758e-02L, - 6.20095678006706402851392309608029322e-02L, - 5.34815246909280872653431472394302968e-02L, - 4.45897513247648766082272993732796902e-02L, - 3.53463607913758462220379484783600481e-02L, - 2.54608473267153201868740010196533594e-02L, - 1.50079473293161225383747630758072681e-02L, - 5.37747987292334898779205143012764982e-03L, - }; - return data; - } -}; +#else -#ifdef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 16> const & abscissa() - { - static const std::array<__float128, 16> data = { - 0.00000000000000000000000000000000000e+00Q, - 1.01142066918717499027074231447392339e-01Q, - 2.01194093997434522300628303394596208e-01Q, - 2.99180007153168812166780024266388963e-01Q, - 3.94151347077563369897207370981045468e-01Q, - 4.85081863640239680693655740232350613e-01Q, - 5.70972172608538847537226737253910641e-01Q, - 6.50996741297416970533735895313274693e-01Q, - 7.24417731360170047416186054613938010e-01Q, - 7.90418501442465932967649294817947347e-01Q, - 8.48206583410427216200648320774216851e-01Q, - 8.97264532344081900882509656454495883e-01Q, - 9.37273392400705904307758947710209471e-01Q, - 9.67739075679139134257347978784337225e-01Q, - 9.87992518020485428489565718586612581e-01Q, - 9.98002298693397060285172840152271209e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(1.01142066918717499027074231447392339e-01Q), + static_cast(2.01194093997434522300628303394596208e-01Q), + static_cast(2.99180007153168812166780024266388963e-01Q), + static_cast(3.94151347077563369897207370981045468e-01Q), + static_cast(4.85081863640239680693655740232350613e-01Q), + static_cast(5.70972172608538847537226737253910641e-01Q), + static_cast(6.50996741297416970533735895313274693e-01Q), + static_cast(7.24417731360170047416186054613938010e-01Q), + static_cast(7.90418501442465932967649294817947347e-01Q), + static_cast(8.48206583410427216200648320774216851e-01Q), + static_cast(8.97264532344081900882509656454495883e-01Q), + static_cast(9.37273392400705904307758947710209471e-01Q), + static_cast(9.67739075679139134257347978784337225e-01Q), + static_cast(9.87992518020485428489565718586612581e-01Q), + static_cast(9.98002298693397060285172840152271209e-01Q), }; return data; } - static std::array<__float128, 16> const & weights() - { - static const std::array<__float128, 16> data = { - 1.01330007014791549017374792767492547e-01Q, - 1.00769845523875595044946662617569722e-01Q, - 9.91735987217919593323931734846031311e-02Q, - 9.66427269836236785051799076275893351e-02Q, - 9.31265981708253212254868727473457186e-02Q, - 8.85644430562117706472754436937743032e-02Q, - 8.30805028231330210382892472861037896e-02Q, - 7.68496807577203788944327774826590067e-02Q, - 6.98541213187282587095200770991474758e-02Q, - 6.20095678006706402851392309608029322e-02Q, - 5.34815246909280872653431472394302968e-02Q, - 4.45897513247648766082272993732796902e-02Q, - 3.53463607913758462220379484783600481e-02Q, - 2.54608473267153201868740010196533594e-02Q, - 1.50079473293161225383747630758072681e-02Q, - 5.37747987292334898779205143012764982e-03Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(1.01330007014791549017374792767492547e-01Q), + static_cast(1.00769845523875595044946662617569722e-01Q), + static_cast(9.91735987217919593323931734846031311e-02Q), + static_cast(9.66427269836236785051799076275893351e-02Q), + static_cast(9.31265981708253212254868727473457186e-02Q), + static_cast(8.85644430562117706472754436937743032e-02Q), + static_cast(8.30805028231330210382892472861037896e-02Q), + static_cast(7.68496807577203788944327774826590067e-02Q), + static_cast(6.98541213187282587095200770991474758e-02Q), + static_cast(6.20095678006706402851392309608029322e-02Q), + static_cast(5.34815246909280872653431472394302968e-02Q), + static_cast(4.45897513247648766082272993732796902e-02Q), + static_cast(3.53463607913758462220379484783600481e-02Q), + static_cast(2.54608473267153201868740010196533594e-02Q), + static_cast(1.50079473293161225383747630758072681e-02Q), + static_cast(5.37747987292334898779205143012764982e-03Q), }; return data; } @@ -664,7 +428,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0114206691871749902707423144739233878745105740164180495800189504151097862454083050931321451540380998341273193681967e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 2.0119409399743452230062830339459620781283645446263767961594972460994823900302018760183625806752105908967902257386509e-01), @@ -681,12 +445,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.6773907567913913425734797878433722528335733730013163797468062226335804249452174804319385048203118506304424717089291e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.8799251802048542848956571858661258114697281712376148999999751558738843736901942471272205036831914497667516843990079e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9800229869339706028517284015227120907340644231555723034839427970683348682837134566648979907760125278631896777136104e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0133000701479154901737479276749254677092627259659629246734858372174107615774696665932418050683956749891773195816338e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0076984552387559504494666261756972191634838013536373069278929029488122760822761077475060185965408326901925180106227e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9173598721791959332393173484603131059567260816713281734860095693651563064308745717056680128223790739026832596087552e-02), @@ -703,247 +467,132 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 2.5460847326715320186874001019653359397271745046864640508377984982400903447009185267605205778819712848080691366407461e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.5007947329316122538374763075807268094639436437387634979291759700896494746154334398961710227490402528151677469993935e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 5.3774798729233489877920514301276498183080402431284197876486169536848635554354599213793172596490038991436925569025913e-03), - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 7.652652113e-02f, - 1.526054652e-01f, - 2.277858511e-01f, - 3.016278681e-01f, - 3.737060887e-01f, - 4.435931752e-01f, - 5.108670020e-01f, - 5.751404468e-01f, - 6.360536807e-01f, - 6.932376563e-01f, - 7.463319065e-01f, - 7.950414288e-01f, - 8.391169718e-01f, - 8.782768113e-01f, - 9.122344283e-01f, - 9.408226338e-01f, - 9.639719273e-01f, - 9.815078775e-01f, - 9.931285992e-01f, - 9.988590316e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 7.660071192e-02f, - 7.637786767e-02f, - 7.570449768e-02f, - 7.458287540e-02f, - 7.303069033e-02f, - 7.105442355e-02f, - 6.864867293e-02f, - 6.583459713e-02f, - 6.265323755e-02f, - 5.911140088e-02f, - 5.519510535e-02f, - 5.094457392e-02f, - 4.643482187e-02f, - 4.166887333e-02f, - 3.660016976e-02f, - 3.128730678e-02f, - 2.588213360e-02f, - 2.038837346e-02f, - 1.462616926e-02f, - 8.600269856e-03f, - 3.073583719e-03f, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 7.65265211334973338e-02, - 1.52605465240922676e-01, - 2.27785851141645078e-01, - 3.01627868114913004e-01, - 3.73706088715419561e-01, - 4.43593175238725103e-01, - 5.10867001950827098e-01, - 5.75140446819710315e-01, - 6.36053680726515025e-01, - 6.93237656334751385e-01, - 7.46331906460150793e-01, - 7.95041428837551198e-01, - 8.39116971822218823e-01, - 8.78276811252281976e-01, - 9.12234428251325906e-01, - 9.40822633831754754e-01, - 9.63971927277913791e-01, - 9.81507877450250259e-01, - 9.93128599185094925e-01, - 9.98859031588277664e-01, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(7.65265211334973337546404093988382110e-02L), + static_cast(1.52605465240922675505220241022677528e-01L), + static_cast(2.27785851141645078080496195368574625e-01L), + static_cast(3.01627868114913004320555356858592261e-01L), + static_cast(3.73706088715419560672548177024927237e-01L), + static_cast(4.43593175238725103199992213492640108e-01L), + static_cast(5.10867001950827098004364050955250998e-01L), + static_cast(5.75140446819710315342946036586425133e-01L), + static_cast(6.36053680726515025452836696226285937e-01L), + static_cast(6.93237656334751384805490711845931533e-01L), + static_cast(7.46331906460150792614305070355641590e-01L), + static_cast(7.95041428837551198350638833272787943e-01L), + static_cast(8.39116971822218823394529061701520685e-01L), + static_cast(8.78276811252281976077442995113078467e-01L), + static_cast(9.12234428251325905867752441203298113e-01L), + static_cast(9.40822633831754753519982722212443380e-01L), + static_cast(9.63971927277913791267666131197277222e-01L), + static_cast(9.81507877450250259193342994720216945e-01L), + static_cast(9.93128599185094924786122388471320278e-01L), + static_cast(9.98859031588277663838315576545863010e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 7.66007119179996564e-02, - 7.63778676720807367e-02, - 7.57044976845566747e-02, - 7.45828754004991890e-02, - 7.30306903327866675e-02, - 7.10544235534440683e-02, - 6.86486729285216193e-02, - 6.58345971336184221e-02, - 6.26532375547811680e-02, - 5.91114008806395724e-02, - 5.51951053482859947e-02, - 5.09445739237286919e-02, - 4.64348218674976747e-02, - 4.16688733279736863e-02, - 3.66001697582007980e-02, - 3.12873067770327990e-02, - 2.58821336049511588e-02, - 2.03883734612665236e-02, - 1.46261692569712530e-02, - 8.60026985564294220e-03, - 3.07358371852053150e-03, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(7.66007119179996564450499015301017408e-02L), + static_cast(7.63778676720807367055028350380610018e-02L), + static_cast(7.57044976845566746595427753766165583e-02L), + static_cast(7.45828754004991889865814183624875286e-02L), + static_cast(7.30306903327866674951894176589131128e-02L), + static_cast(7.10544235534440683057903617232101674e-02L), + static_cast(6.86486729285216193456234118853678017e-02L), + static_cast(6.58345971336184221115635569693979431e-02L), + static_cast(6.26532375547811680258701221742549806e-02L), + static_cast(5.91114008806395723749672206485942171e-02L), + static_cast(5.51951053482859947448323724197773292e-02L), + static_cast(5.09445739237286919327076700503449487e-02L), + static_cast(4.64348218674976747202318809261075168e-02L), + static_cast(4.16688733279736862637883059368947380e-02L), + static_cast(3.66001697582007980305572407072110085e-02L), + static_cast(3.12873067770327989585431193238007379e-02L), + static_cast(2.58821336049511588345050670961531430e-02L), + static_cast(2.03883734612665235980102314327547051e-02L), + static_cast(1.46261692569712529837879603088683562e-02L), + static_cast(8.60026985564294219866178795010234725e-03L), + static_cast(3.07358371852053150121829324603098749e-03L), }; return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 7.65265211334973337546404093988382110e-02L, - 1.52605465240922675505220241022677528e-01L, - 2.27785851141645078080496195368574625e-01L, - 3.01627868114913004320555356858592261e-01L, - 3.73706088715419560672548177024927237e-01L, - 4.43593175238725103199992213492640108e-01L, - 5.10867001950827098004364050955250998e-01L, - 5.75140446819710315342946036586425133e-01L, - 6.36053680726515025452836696226285937e-01L, - 6.93237656334751384805490711845931533e-01L, - 7.46331906460150792614305070355641590e-01L, - 7.95041428837551198350638833272787943e-01L, - 8.39116971822218823394529061701520685e-01L, - 8.78276811252281976077442995113078467e-01L, - 9.12234428251325905867752441203298113e-01L, - 9.40822633831754753519982722212443380e-01L, - 9.63971927277913791267666131197277222e-01L, - 9.81507877450250259193342994720216945e-01L, - 9.93128599185094924786122388471320278e-01L, - 9.98859031588277663838315576545863010e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 7.66007119179996564450499015301017408e-02L, - 7.63778676720807367055028350380610018e-02L, - 7.57044976845566746595427753766165583e-02L, - 7.45828754004991889865814183624875286e-02L, - 7.30306903327866674951894176589131128e-02L, - 7.10544235534440683057903617232101674e-02L, - 6.86486729285216193456234118853678017e-02L, - 6.58345971336184221115635569693979431e-02L, - 6.26532375547811680258701221742549806e-02L, - 5.91114008806395723749672206485942171e-02L, - 5.51951053482859947448323724197773292e-02L, - 5.09445739237286919327076700503449487e-02L, - 4.64348218674976747202318809261075168e-02L, - 4.16688733279736862637883059368947380e-02L, - 3.66001697582007980305572407072110085e-02L, - 3.12873067770327989585431193238007379e-02L, - 2.58821336049511588345050670961531430e-02L, - 2.03883734612665235980102314327547051e-02L, - 1.46261692569712529837879603088683562e-02L, - 8.60026985564294219866178795010234725e-03L, - 3.07358371852053150121829324603098749e-03L, - }; - return data; - } -}; +#else -#ifdef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 21> const & abscissa() - { - static const std::array<__float128, 21> data = { - 0.00000000000000000000000000000000000e+00Q, - 7.65265211334973337546404093988382110e-02Q, - 1.52605465240922675505220241022677528e-01Q, - 2.27785851141645078080496195368574625e-01Q, - 3.01627868114913004320555356858592261e-01Q, - 3.73706088715419560672548177024927237e-01Q, - 4.43593175238725103199992213492640108e-01Q, - 5.10867001950827098004364050955250998e-01Q, - 5.75140446819710315342946036586425133e-01Q, - 6.36053680726515025452836696226285937e-01Q, - 6.93237656334751384805490711845931533e-01Q, - 7.46331906460150792614305070355641590e-01Q, - 7.95041428837551198350638833272787943e-01Q, - 8.39116971822218823394529061701520685e-01Q, - 8.78276811252281976077442995113078467e-01Q, - 9.12234428251325905867752441203298113e-01Q, - 9.40822633831754753519982722212443380e-01Q, - 9.63971927277913791267666131197277222e-01Q, - 9.81507877450250259193342994720216945e-01Q, - 9.93128599185094924786122388471320278e-01Q, - 9.98859031588277663838315576545863010e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(7.65265211334973337546404093988382110e-02Q), + static_cast(1.52605465240922675505220241022677528e-01Q), + static_cast(2.27785851141645078080496195368574625e-01Q), + static_cast(3.01627868114913004320555356858592261e-01Q), + static_cast(3.73706088715419560672548177024927237e-01Q), + static_cast(4.43593175238725103199992213492640108e-01Q), + static_cast(5.10867001950827098004364050955250998e-01Q), + static_cast(5.75140446819710315342946036586425133e-01Q), + static_cast(6.36053680726515025452836696226285937e-01Q), + static_cast(6.93237656334751384805490711845931533e-01Q), + static_cast(7.46331906460150792614305070355641590e-01Q), + static_cast(7.95041428837551198350638833272787943e-01Q), + static_cast(8.39116971822218823394529061701520685e-01Q), + static_cast(8.78276811252281976077442995113078467e-01Q), + static_cast(9.12234428251325905867752441203298113e-01Q), + static_cast(9.40822633831754753519982722212443380e-01Q), + static_cast(9.63971927277913791267666131197277222e-01Q), + static_cast(9.81507877450250259193342994720216945e-01Q), + static_cast(9.93128599185094924786122388471320278e-01Q), + static_cast(9.98859031588277663838315576545863010e-01Q), }; return data; } - static std::array<__float128, 21> const & weights() - { - static const std::array<__float128, 21> data = { - 7.66007119179996564450499015301017408e-02Q, - 7.63778676720807367055028350380610018e-02Q, - 7.57044976845566746595427753766165583e-02Q, - 7.45828754004991889865814183624875286e-02Q, - 7.30306903327866674951894176589131128e-02Q, - 7.10544235534440683057903617232101674e-02Q, - 6.86486729285216193456234118853678017e-02Q, - 6.58345971336184221115635569693979431e-02Q, - 6.26532375547811680258701221742549806e-02Q, - 5.91114008806395723749672206485942171e-02Q, - 5.51951053482859947448323724197773292e-02Q, - 5.09445739237286919327076700503449487e-02Q, - 4.64348218674976747202318809261075168e-02Q, - 4.16688733279736862637883059368947380e-02Q, - 3.66001697582007980305572407072110085e-02Q, - 3.12873067770327989585431193238007379e-02Q, - 2.58821336049511588345050670961531430e-02Q, - 2.03883734612665235980102314327547051e-02Q, - 1.46261692569712529837879603088683562e-02Q, - 8.60026985564294219866178795010234725e-03Q, - 3.07358371852053150121829324603098749e-03Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(7.66007119179996564450499015301017408e-02Q), + static_cast(7.63778676720807367055028350380610018e-02Q), + static_cast(7.57044976845566746595427753766165583e-02Q), + static_cast(7.45828754004991889865814183624875286e-02Q), + static_cast(7.30306903327866674951894176589131128e-02Q), + static_cast(7.10544235534440683057903617232101674e-02Q), + static_cast(6.86486729285216193456234118853678017e-02Q), + static_cast(6.58345971336184221115635569693979431e-02Q), + static_cast(6.26532375547811680258701221742549806e-02Q), + static_cast(5.91114008806395723749672206485942171e-02Q), + static_cast(5.51951053482859947448323724197773292e-02Q), + static_cast(5.09445739237286919327076700503449487e-02Q), + static_cast(4.64348218674976747202318809261075168e-02Q), + static_cast(4.16688733279736862637883059368947380e-02Q), + static_cast(3.66001697582007980305572407072110085e-02Q), + static_cast(3.12873067770327989585431193238007379e-02Q), + static_cast(2.58821336049511588345050670961531430e-02Q), + static_cast(2.03883734612665235980102314327547051e-02Q), + static_cast(1.46261692569712529837879603088683562e-02Q), + static_cast(8.60026985564294219866178795010234725e-03Q), + static_cast(3.07358371852053150121829324603098749e-03Q), }; return data; } @@ -956,7 +605,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.6526521133497333754640409398838211004796266813497500804795244384256342048336978241545114181556215606998505646364133e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.5260546524092267550522024102267752791167622481841730660174156703809133685751696356987995886397049724808931527012542e-01), @@ -978,12 +627,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.8150787745025025919334299472021694456725093981023759869077533318793098857465723460898060491887511355706497739384103e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9312859918509492478612238847132027822264713090165589614818413121798471762775378083944940249657220927472894034724419e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9885903158827766383831557654586300999957020432629666866666860339324411793311982967839129772854179884971700274369367e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 7.6600711917999656445049901530101740827932500628670118055485349620314721456712029449597396569857880493210849110825276e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.6377867672080736705502835038061001800801036764945996714946431116936745542061941050008345047482501253320401746334511e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 7.5704497684556674659542775376616558263363155900414326194855223272348838596099414841886740468379707283366777797425290e-02), @@ -1005,287 +654,152 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 1.4626169256971252983787960308868356163881050162249770342103474631076960029748751959380482484308382288261238476948520e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 8.6002698556429421986617879501023472521289227667077976622450602031426535362696437838448828009554532025301579670206091e-03), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.0735837185205315012182932460309874880335046882543449198461628212114333665590378156706265241414469306987988292234740e-03), - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 6.154448301e-02f, - 1.228646926e-01f, - 1.837189394e-01f, - 2.438668837e-01f, - 3.030895389e-01f, - 3.611723058e-01f, - 4.178853822e-01f, - 4.730027314e-01f, - 5.263252843e-01f, - 5.776629302e-01f, - 6.268100990e-01f, - 6.735663685e-01f, - 7.177664068e-01f, - 7.592592630e-01f, - 7.978737980e-01f, - 8.334426288e-01f, - 8.658470653e-01f, - 8.949919979e-01f, - 9.207471153e-01f, - 9.429745712e-01f, - 9.616149864e-01f, - 9.766639215e-01f, - 9.880357945e-01f, - 9.955569698e-01f, - 9.992621050e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 6.158081807e-02f, - 6.147118987e-02f, - 6.112850972e-02f, - 6.053945538e-02f, - 5.972034032e-02f, - 5.868968002e-02f, - 5.743711636e-02f, - 5.595081122e-02f, - 5.425112989e-02f, - 5.236288581e-02f, - 5.027767908e-02f, - 4.798253714e-02f, - 4.550291305e-02f, - 4.287284502e-02f, - 4.008382550e-02f, - 3.711627148e-02f, - 3.400213027e-02f, - 3.079230017e-02f, - 2.747531759e-02f, - 2.400994561e-02f, - 2.043537115e-02f, - 1.684781771e-02f, - 1.323622920e-02f, - 9.473973386e-03f, - 5.561932135e-03f, - 1.987383892e-03f, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 6.15444830056850789e-02, - 1.22864692610710396e-01, - 1.83718939421048892e-01, - 2.43866883720988432e-01, - 3.03089538931107830e-01, - 3.61172305809387838e-01, - 4.17885382193037749e-01, - 4.73002731445714961e-01, - 5.26325284334719183e-01, - 5.77662930241222968e-01, - 6.26810099010317413e-01, - 6.73566368473468364e-01, - 7.17766406813084388e-01, - 7.59259263037357631e-01, - 7.97873797998500059e-01, - 8.33442628760834001e-01, - 8.65847065293275595e-01, - 8.94991997878275369e-01, - 9.20747115281701562e-01, - 9.42974571228974339e-01, - 9.61614986425842512e-01, - 9.76663921459517511e-01, - 9.88035794534077248e-01, - 9.95556969790498098e-01, - 9.99262104992609834e-01, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(6.15444830056850788865463923667966313e-02L), + static_cast(1.22864692610710396387359818808036806e-01L), + static_cast(1.83718939421048892015969888759528416e-01L), + static_cast(2.43866883720988432045190362797451586e-01L), + static_cast(3.03089538931107830167478909980339329e-01L), + static_cast(3.61172305809387837735821730127640667e-01L), + static_cast(4.17885382193037748851814394594572487e-01L), + static_cast(4.73002731445714960522182115009192041e-01L), + static_cast(5.26325284334719182599623778158010178e-01L), + static_cast(5.77662930241222967723689841612654067e-01L), + static_cast(6.26810099010317412788122681624517881e-01L), + static_cast(6.73566368473468364485120633247622176e-01L), + static_cast(7.17766406813084388186654079773297781e-01L), + static_cast(7.59259263037357630577282865204360976e-01L), + static_cast(7.97873797998500059410410904994306569e-01L), + static_cast(8.33442628760834001421021108693569569e-01L), + static_cast(8.65847065293275595448996969588340088e-01L), + static_cast(8.94991997878275368851042006782804954e-01L), + static_cast(9.20747115281701561746346084546330632e-01L), + static_cast(9.42974571228974339414011169658470532e-01L), + static_cast(9.61614986425842512418130033660167242e-01L), + static_cast(9.76663921459517511498315386479594068e-01L), + static_cast(9.88035794534077247637331014577406227e-01L), + static_cast(9.95556969790498097908784946893901617e-01L), + static_cast(9.99262104992609834193457486540340594e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 6.15808180678329351e-02, - 6.14711898714253167e-02, - 6.11285097170530483e-02, - 6.05394553760458629e-02, - 5.97203403241740600e-02, - 5.86896800223942080e-02, - 5.74371163615678329e-02, - 5.59508112204123173e-02, - 5.42511298885454901e-02, - 5.23628858064074759e-02, - 5.02776790807156720e-02, - 4.79825371388367139e-02, - 4.55029130499217889e-02, - 4.28728450201700495e-02, - 4.00838255040323821e-02, - 3.71162714834155436e-02, - 3.40021302743293378e-02, - 3.07923001673874889e-02, - 2.74753175878517378e-02, - 2.40099456069532162e-02, - 2.04353711458828355e-02, - 1.68478177091282982e-02, - 1.32362291955716748e-02, - 9.47397338617415161e-03, - 5.56193213535671376e-03, - 1.98738389233031593e-03, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(6.15808180678329350787598242400645532e-02L), + static_cast(6.14711898714253166615441319652641776e-02L), + static_cast(6.11285097170530483058590304162927119e-02L), + static_cast(6.05394553760458629453602675175654272e-02L), + static_cast(5.97203403241740599790992919325618538e-02L), + static_cast(5.86896800223942079619741758567877641e-02L), + static_cast(5.74371163615678328535826939395064720e-02L), + static_cast(5.59508112204123173082406863827473468e-02L), + static_cast(5.42511298885454901445433704598756068e-02L), + static_cast(5.23628858064074758643667121378727149e-02L), + static_cast(5.02776790807156719633252594334400844e-02L), + static_cast(4.79825371388367139063922557569147550e-02L), + static_cast(4.55029130499217889098705847526603930e-02L), + static_cast(4.28728450201700494768957924394951611e-02L), + static_cast(4.00838255040323820748392844670756464e-02L), + static_cast(3.71162714834155435603306253676198760e-02L), + static_cast(3.40021302743293378367487952295512032e-02L), + static_cast(3.07923001673874888911090202152285856e-02L), + static_cast(2.74753175878517378029484555178110786e-02L), + static_cast(2.40099456069532162200924891648810814e-02L), + static_cast(2.04353711458828354565682922359389737e-02L), + static_cast(1.68478177091282982315166675363363158e-02L), + static_cast(1.32362291955716748136564058469762381e-02L), + static_cast(9.47397338617415160720771052365532387e-03L), + static_cast(5.56193213535671375804023690106552207e-03L), + static_cast(1.98738389233031592650785188284340989e-03L), }; return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 6.15444830056850788865463923667966313e-02L, - 1.22864692610710396387359818808036806e-01L, - 1.83718939421048892015969888759528416e-01L, - 2.43866883720988432045190362797451586e-01L, - 3.03089538931107830167478909980339329e-01L, - 3.61172305809387837735821730127640667e-01L, - 4.17885382193037748851814394594572487e-01L, - 4.73002731445714960522182115009192041e-01L, - 5.26325284334719182599623778158010178e-01L, - 5.77662930241222967723689841612654067e-01L, - 6.26810099010317412788122681624517881e-01L, - 6.73566368473468364485120633247622176e-01L, - 7.17766406813084388186654079773297781e-01L, - 7.59259263037357630577282865204360976e-01L, - 7.97873797998500059410410904994306569e-01L, - 8.33442628760834001421021108693569569e-01L, - 8.65847065293275595448996969588340088e-01L, - 8.94991997878275368851042006782804954e-01L, - 9.20747115281701561746346084546330632e-01L, - 9.42974571228974339414011169658470532e-01L, - 9.61614986425842512418130033660167242e-01L, - 9.76663921459517511498315386479594068e-01L, - 9.88035794534077247637331014577406227e-01L, - 9.95556969790498097908784946893901617e-01L, - 9.99262104992609834193457486540340594e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 6.15808180678329350787598242400645532e-02L, - 6.14711898714253166615441319652641776e-02L, - 6.11285097170530483058590304162927119e-02L, - 6.05394553760458629453602675175654272e-02L, - 5.97203403241740599790992919325618538e-02L, - 5.86896800223942079619741758567877641e-02L, - 5.74371163615678328535826939395064720e-02L, - 5.59508112204123173082406863827473468e-02L, - 5.42511298885454901445433704598756068e-02L, - 5.23628858064074758643667121378727149e-02L, - 5.02776790807156719633252594334400844e-02L, - 4.79825371388367139063922557569147550e-02L, - 4.55029130499217889098705847526603930e-02L, - 4.28728450201700494768957924394951611e-02L, - 4.00838255040323820748392844670756464e-02L, - 3.71162714834155435603306253676198760e-02L, - 3.40021302743293378367487952295512032e-02L, - 3.07923001673874888911090202152285856e-02L, - 2.74753175878517378029484555178110786e-02L, - 2.40099456069532162200924891648810814e-02L, - 2.04353711458828354565682922359389737e-02L, - 1.68478177091282982315166675363363158e-02L, - 1.32362291955716748136564058469762381e-02L, - 9.47397338617415160720771052365532387e-03L, - 5.56193213535671375804023690106552207e-03L, - 1.98738389233031592650785188284340989e-03L, - }; - return data; - } -}; +#else -#ifdef BOOST_HAS_FLOAT128 template class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 26> const & abscissa() - { - static const std::array<__float128, 26> data = { - 0.00000000000000000000000000000000000e+00Q, - 6.15444830056850788865463923667966313e-02Q, - 1.22864692610710396387359818808036806e-01Q, - 1.83718939421048892015969888759528416e-01Q, - 2.43866883720988432045190362797451586e-01Q, - 3.03089538931107830167478909980339329e-01Q, - 3.61172305809387837735821730127640667e-01Q, - 4.17885382193037748851814394594572487e-01Q, - 4.73002731445714960522182115009192041e-01Q, - 5.26325284334719182599623778158010178e-01Q, - 5.77662930241222967723689841612654067e-01Q, - 6.26810099010317412788122681624517881e-01Q, - 6.73566368473468364485120633247622176e-01Q, - 7.17766406813084388186654079773297781e-01Q, - 7.59259263037357630577282865204360976e-01Q, - 7.97873797998500059410410904994306569e-01Q, - 8.33442628760834001421021108693569569e-01Q, - 8.65847065293275595448996969588340088e-01Q, - 8.94991997878275368851042006782804954e-01Q, - 9.20747115281701561746346084546330632e-01Q, - 9.42974571228974339414011169658470532e-01Q, - 9.61614986425842512418130033660167242e-01Q, - 9.76663921459517511498315386479594068e-01Q, - 9.88035794534077247637331014577406227e-01Q, - 9.95556969790498097908784946893901617e-01Q, - 9.99262104992609834193457486540340594e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(6.15444830056850788865463923667966313e-02Q), + static_cast(1.22864692610710396387359818808036806e-01Q), + static_cast(1.83718939421048892015969888759528416e-01Q), + static_cast(2.43866883720988432045190362797451586e-01Q), + static_cast(3.03089538931107830167478909980339329e-01Q), + static_cast(3.61172305809387837735821730127640667e-01Q), + static_cast(4.17885382193037748851814394594572487e-01Q), + static_cast(4.73002731445714960522182115009192041e-01Q), + static_cast(5.26325284334719182599623778158010178e-01Q), + static_cast(5.77662930241222967723689841612654067e-01Q), + static_cast(6.26810099010317412788122681624517881e-01Q), + static_cast(6.73566368473468364485120633247622176e-01Q), + static_cast(7.17766406813084388186654079773297781e-01Q), + static_cast(7.59259263037357630577282865204360976e-01Q), + static_cast(7.97873797998500059410410904994306569e-01Q), + static_cast(8.33442628760834001421021108693569569e-01Q), + static_cast(8.65847065293275595448996969588340088e-01Q), + static_cast(8.94991997878275368851042006782804954e-01Q), + static_cast(9.20747115281701561746346084546330632e-01Q), + static_cast(9.42974571228974339414011169658470532e-01Q), + static_cast(9.61614986425842512418130033660167242e-01Q), + static_cast(9.76663921459517511498315386479594068e-01Q), + static_cast(9.88035794534077247637331014577406227e-01Q), + static_cast(9.95556969790498097908784946893901617e-01Q), + static_cast(9.99262104992609834193457486540340594e-01Q), }; return data; } - static std::array<__float128, 26> const & weights() - { - static const std::array<__float128, 26> data = { - 6.15808180678329350787598242400645532e-02Q, - 6.14711898714253166615441319652641776e-02Q, - 6.11285097170530483058590304162927119e-02Q, - 6.05394553760458629453602675175654272e-02Q, - 5.97203403241740599790992919325618538e-02Q, - 5.86896800223942079619741758567877641e-02Q, - 5.74371163615678328535826939395064720e-02Q, - 5.59508112204123173082406863827473468e-02Q, - 5.42511298885454901445433704598756068e-02Q, - 5.23628858064074758643667121378727149e-02Q, - 5.02776790807156719633252594334400844e-02Q, - 4.79825371388367139063922557569147550e-02Q, - 4.55029130499217889098705847526603930e-02Q, - 4.28728450201700494768957924394951611e-02Q, - 4.00838255040323820748392844670756464e-02Q, - 3.71162714834155435603306253676198760e-02Q, - 3.40021302743293378367487952295512032e-02Q, - 3.07923001673874888911090202152285856e-02Q, - 2.74753175878517378029484555178110786e-02Q, - 2.40099456069532162200924891648810814e-02Q, - 2.04353711458828354565682922359389737e-02Q, - 1.68478177091282982315166675363363158e-02Q, - 1.32362291955716748136564058469762381e-02Q, - 9.47397338617415160720771052365532387e-03Q, - 5.56193213535671375804023690106552207e-03Q, - 1.98738389233031592650785188284340989e-03Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(6.15808180678329350787598242400645532e-02Q), + static_cast(6.14711898714253166615441319652641776e-02Q), + static_cast(6.11285097170530483058590304162927119e-02Q), + static_cast(6.05394553760458629453602675175654272e-02Q), + static_cast(5.97203403241740599790992919325618538e-02Q), + static_cast(5.86896800223942079619741758567877641e-02Q), + static_cast(5.74371163615678328535826939395064720e-02Q), + static_cast(5.59508112204123173082406863827473468e-02Q), + static_cast(5.42511298885454901445433704598756068e-02Q), + static_cast(5.23628858064074758643667121378727149e-02Q), + static_cast(5.02776790807156719633252594334400844e-02Q), + static_cast(4.79825371388367139063922557569147550e-02Q), + static_cast(4.55029130499217889098705847526603930e-02Q), + static_cast(4.28728450201700494768957924394951611e-02Q), + static_cast(4.00838255040323820748392844670756464e-02Q), + static_cast(3.71162714834155435603306253676198760e-02Q), + static_cast(3.40021302743293378367487952295512032e-02Q), + static_cast(3.07923001673874888911090202152285856e-02Q), + static_cast(2.74753175878517378029484555178110786e-02Q), + static_cast(2.40099456069532162200924891648810814e-02Q), + static_cast(2.04353711458828354565682922359389737e-02Q), + static_cast(1.68478177091282982315166675363363158e-02Q), + static_cast(1.32362291955716748136564058469762381e-02Q), + static_cast(9.47397338617415160720771052365532387e-03Q), + static_cast(5.56193213535671375804023690106552207e-03Q), + static_cast(1.98738389233031592650785188284340989e-03Q), }; return data; } @@ -1298,7 +812,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.1544483005685078886546392366796631281724348039823545274305431751687279361558658545141048781022691067898008423227288e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.2286469261071039638735981880803680553220534604978373842389353789270883496885841582643884994633105537597765980412320e-01), @@ -1325,12 +839,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.8803579453407724763733101457740622707248415209160748131449972199405186821347293686245404742032360498210710718706868e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9555696979049809790878494689390161725756264940480817121080493113293348134372793448728802635294700756868258870429256e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9926210499260983419345748654034059370452496042279618586228697762904524428167719073818746102238075978747461480736921e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 6.1580818067832935078759824240064553190436936903140808056908996403358367244202623293256774502185186717703954810463664e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.1471189871425316661544131965264177586537962876885022711111683500151700796198726558483367566537422877227096643444043e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 6.1128509717053048305859030416292711922678552321960938357322028070390133769952032831204895569347757809858568165047769e-02), @@ -1357,327 +871,172 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.4739733861741516072077105236553238716453268483726334971394029603529306140359023187904705754719643032594360138998941e-03), BOOST_MATH_HUGE_CONSTANT(T, 0, 5.5619321353567137580402369010655220701769295496290984052961210793810038857581724171021610100708799763006942755331129e-03), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.9873838923303159265078518828434098894299804282505973837653346298985629336820118753523093675303476883723992297810124e-03), - }; + }; // LCOV_EXCL_STOP return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.000000000e+00f, - 5.147184256e-02f, - 1.028069380e-01f, - 1.538699136e-01f, - 2.045251167e-01f, - 2.546369262e-01f, - 3.040732023e-01f, - 3.527047255e-01f, - 4.004012548e-01f, - 4.470337695e-01f, - 4.924804679e-01f, - 5.366241481e-01f, - 5.793452358e-01f, - 6.205261830e-01f, - 6.600610641e-01f, - 6.978504948e-01f, - 7.337900625e-01f, - 7.677774321e-01f, - 7.997278358e-01f, - 8.295657624e-01f, - 8.572052335e-01f, - 8.825605358e-01f, - 9.055733077e-01f, - 9.262000474e-01f, - 9.443744447e-01f, - 9.600218650e-01f, - 9.731163225e-01f, - 9.836681233e-01f, - 9.916309969e-01f, - 9.968934841e-01f, - 9.994844101e-01f, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 5.149472943e-02f, - 5.142612854e-02f, - 5.122154785e-02f, - 5.088179590e-02f, - 5.040592140e-02f, - 4.979568343e-02f, - 4.905543456e-02f, - 4.818586176e-02f, - 4.718554657e-02f, - 4.605923827e-02f, - 4.481480013e-02f, - 4.345253970e-02f, - 4.196981022e-02f, - 4.037453895e-02f, - 3.867894562e-02f, - 3.688236465e-02f, - 3.497933803e-02f, - 3.298144706e-02f, - 3.090725756e-02f, - 2.875404877e-02f, - 2.650995488e-02f, - 2.419116208e-02f, - 2.182803582e-02f, - 1.941414119e-02f, - 1.692088919e-02f, - 1.436972951e-02f, - 1.182301525e-02f, - 9.273279660e-03f, - 6.630703916e-03f, - 3.890461127e-03f, - 1.389013699e-03f, - }; - return data; - } -}; +#ifndef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000e+00, - 5.14718425553176958e-02, - 1.02806937966737030e-01, - 1.53869913608583547e-01, - 2.04525116682309891e-01, - 2.54636926167889846e-01, - 3.04073202273625077e-01, - 3.52704725530878113e-01, - 4.00401254830394393e-01, - 4.47033769538089177e-01, - 4.92480467861778575e-01, - 5.36624148142019899e-01, - 5.79345235826361692e-01, - 6.20526182989242861e-01, - 6.60061064126626961e-01, - 6.97850494793315797e-01, - 7.33790062453226805e-01, - 7.67777432104826195e-01, - 7.99727835821839083e-01, - 8.29565762382768397e-01, - 8.57205233546061099e-01, - 8.82560535792052682e-01, - 9.05573307699907799e-01, - 9.26200047429274326e-01, - 9.44374444748559979e-01, - 9.60021864968307512e-01, - 9.73116322501126268e-01, - 9.83668123279747210e-01, - 9.91630996870404595e-01, - 9.96893484074649540e-01, - 9.99484410050490638e-01, + static std::array const & abscissa() + { + static constexpr std::array data = { + static_cast(0.00000000000000000000000000000000000e+00L), + static_cast(5.14718425553176958330252131667225737e-02L), + static_cast(1.02806937966737030147096751318000592e-01L), + static_cast(1.53869913608583546963794672743255920e-01L), + static_cast(2.04525116682309891438957671002024710e-01L), + static_cast(2.54636926167889846439805129817805108e-01L), + static_cast(3.04073202273625077372677107199256554e-01L), + static_cast(3.52704725530878113471037207089373861e-01L), + static_cast(4.00401254830394392535476211542660634e-01L), + static_cast(4.47033769538089176780609900322854000e-01L), + static_cast(4.92480467861778574993693061207708796e-01L), + static_cast(5.36624148142019899264169793311072794e-01L), + static_cast(5.79345235826361691756024932172540496e-01L), + static_cast(6.20526182989242861140477556431189299e-01L), + static_cast(6.60061064126626961370053668149270753e-01L), + static_cast(6.97850494793315796932292388026640068e-01L), + static_cast(7.33790062453226804726171131369527646e-01L), + static_cast(7.67777432104826194917977340974503132e-01L), + static_cast(7.99727835821839083013668942322683241e-01L), + static_cast(8.29565762382768397442898119732501916e-01L), + static_cast(8.57205233546061098958658510658943857e-01L), + static_cast(8.82560535792052681543116462530225590e-01L), + static_cast(9.05573307699907798546522558925958320e-01L), + static_cast(9.26200047429274325879324277080474004e-01L), + static_cast(9.44374444748559979415831324037439122e-01L), + static_cast(9.60021864968307512216871025581797663e-01L), + static_cast(9.73116322501126268374693868423706885e-01L), + static_cast(9.83668123279747209970032581605662802e-01L), + static_cast(9.91630996870404594858628366109485725e-01L), + static_cast(9.96893484074649540271630050918695283e-01L), + static_cast(9.99484410050490637571325895705810819e-01L), }; return data; } - static std::array const & weights() - { - static constexpr std::array data = { - 5.14947294294515676e-02, - 5.14261285374590259e-02, - 5.12215478492587722e-02, - 5.08817958987496065e-02, - 5.04059214027823468e-02, - 4.97956834270742064e-02, - 4.90554345550297789e-02, - 4.81858617570871291e-02, - 4.71855465692991539e-02, - 4.60592382710069881e-02, - 4.48148001331626632e-02, - 4.34525397013560693e-02, - 4.19698102151642461e-02, - 4.03745389515359591e-02, - 3.86789456247275930e-02, - 3.68823646518212292e-02, - 3.49793380280600241e-02, - 3.29814470574837260e-02, - 3.09072575623877625e-02, - 2.87540487650412928e-02, - 2.65099548823331016e-02, - 2.41911620780806014e-02, - 2.18280358216091923e-02, - 1.94141411939423812e-02, - 1.69208891890532726e-02, - 1.43697295070458048e-02, - 1.18230152534963417e-02, - 9.27327965951776343e-03, - 6.63070391593129217e-03, - 3.89046112709988405e-03, - 1.38901369867700762e-03, + static std::array const & weights() + { + static constexpr std::array data = { + static_cast(5.14947294294515675583404336470993075e-02L), + static_cast(5.14261285374590259338628792157812598e-02L), + static_cast(5.12215478492587721706562826049442083e-02L), + static_cast(5.08817958987496064922974730498046919e-02L), + static_cast(5.04059214027823468408930856535850289e-02L), + static_cast(4.97956834270742063578115693799423285e-02L), + static_cast(4.90554345550297788875281653672381736e-02L), + static_cast(4.81858617570871291407794922983045926e-02L), + static_cast(4.71855465692991539452614781810994865e-02L), + static_cast(4.60592382710069881162717355593735806e-02L), + static_cast(4.48148001331626631923555516167232438e-02L), + static_cast(4.34525397013560693168317281170732581e-02L), + static_cast(4.19698102151642461471475412859697578e-02L), + static_cast(4.03745389515359591119952797524681142e-02L), + static_cast(3.86789456247275929503486515322810503e-02L), + static_cast(3.68823646518212292239110656171359677e-02L), + static_cast(3.49793380280600241374996707314678751e-02L), + static_cast(3.29814470574837260318141910168539275e-02L), + static_cast(3.09072575623877624728842529430922726e-02L), + static_cast(2.87540487650412928439787853543342111e-02L), + static_cast(2.65099548823331016106017093350754144e-02L), + static_cast(2.41911620780806013656863707252320268e-02L), + static_cast(2.18280358216091922971674857383389934e-02L), + static_cast(1.94141411939423811734089510501284559e-02L), + static_cast(1.69208891890532726275722894203220924e-02L), + static_cast(1.43697295070458048124514324435800102e-02L), + static_cast(1.18230152534963417422328988532505929e-02L), + static_cast(9.27327965951776342844114689202436042e-03L), + static_cast(6.63070391593129217331982636975016813e-03L), + static_cast(3.89046112709988405126720184451550328e-03L), + static_cast(1.38901369867700762455159122675969968e-03L), }; return data; } }; -template -class gauss_kronrod_detail -{ -public: - static std::array const & abscissa() - { - static constexpr std::array data = { - 0.00000000000000000000000000000000000e+00L, - 5.14718425553176958330252131667225737e-02L, - 1.02806937966737030147096751318000592e-01L, - 1.53869913608583546963794672743255920e-01L, - 2.04525116682309891438957671002024710e-01L, - 2.54636926167889846439805129817805108e-01L, - 3.04073202273625077372677107199256554e-01L, - 3.52704725530878113471037207089373861e-01L, - 4.00401254830394392535476211542660634e-01L, - 4.47033769538089176780609900322854000e-01L, - 4.92480467861778574993693061207708796e-01L, - 5.36624148142019899264169793311072794e-01L, - 5.79345235826361691756024932172540496e-01L, - 6.20526182989242861140477556431189299e-01L, - 6.60061064126626961370053668149270753e-01L, - 6.97850494793315796932292388026640068e-01L, - 7.33790062453226804726171131369527646e-01L, - 7.67777432104826194917977340974503132e-01L, - 7.99727835821839083013668942322683241e-01L, - 8.29565762382768397442898119732501916e-01L, - 8.57205233546061098958658510658943857e-01L, - 8.82560535792052681543116462530225590e-01L, - 9.05573307699907798546522558925958320e-01L, - 9.26200047429274325879324277080474004e-01L, - 9.44374444748559979415831324037439122e-01L, - 9.60021864968307512216871025581797663e-01L, - 9.73116322501126268374693868423706885e-01L, - 9.83668123279747209970032581605662802e-01L, - 9.91630996870404594858628366109485725e-01L, - 9.96893484074649540271630050918695283e-01L, - 9.99484410050490637571325895705810819e-01L, - }; - return data; - } - static std::array const & weights() - { - static constexpr std::array data = { - 5.14947294294515675583404336470993075e-02L, - 5.14261285374590259338628792157812598e-02L, - 5.12215478492587721706562826049442083e-02L, - 5.08817958987496064922974730498046919e-02L, - 5.04059214027823468408930856535850289e-02L, - 4.97956834270742063578115693799423285e-02L, - 4.90554345550297788875281653672381736e-02L, - 4.81858617570871291407794922983045926e-02L, - 4.71855465692991539452614781810994865e-02L, - 4.60592382710069881162717355593735806e-02L, - 4.48148001331626631923555516167232438e-02L, - 4.34525397013560693168317281170732581e-02L, - 4.19698102151642461471475412859697578e-02L, - 4.03745389515359591119952797524681142e-02L, - 3.86789456247275929503486515322810503e-02L, - 3.68823646518212292239110656171359677e-02L, - 3.49793380280600241374996707314678751e-02L, - 3.29814470574837260318141910168539275e-02L, - 3.09072575623877624728842529430922726e-02L, - 2.87540487650412928439787853543342111e-02L, - 2.65099548823331016106017093350754144e-02L, - 2.41911620780806013656863707252320268e-02L, - 2.18280358216091922971674857383389934e-02L, - 1.94141411939423811734089510501284559e-02L, - 1.69208891890532726275722894203220924e-02L, - 1.43697295070458048124514324435800102e-02L, - 1.18230152534963417422328988532505929e-02L, - 9.27327965951776342844114689202436042e-03L, - 6.63070391593129217331982636975016813e-03L, - 3.89046112709988405126720184451550328e-03L, - 1.38901369867700762455159122675969968e-03L, - }; - return data; - } -}; +#else -#ifdef BOOST_HAS_FLOAT128 template -class gauss_kronrod_detail +class gauss_kronrod_detail { + using storage_type = typename gauss_constant_category::storage_type; public: - static std::array<__float128, 31> const & abscissa() - { - static const std::array<__float128, 31> data = { - 0.00000000000000000000000000000000000e+00Q, - 5.14718425553176958330252131667225737e-02Q, - 1.02806937966737030147096751318000592e-01Q, - 1.53869913608583546963794672743255920e-01Q, - 2.04525116682309891438957671002024710e-01Q, - 2.54636926167889846439805129817805108e-01Q, - 3.04073202273625077372677107199256554e-01Q, - 3.52704725530878113471037207089373861e-01Q, - 4.00401254830394392535476211542660634e-01Q, - 4.47033769538089176780609900322854000e-01Q, - 4.92480467861778574993693061207708796e-01Q, - 5.36624148142019899264169793311072794e-01Q, - 5.79345235826361691756024932172540496e-01Q, - 6.20526182989242861140477556431189299e-01Q, - 6.60061064126626961370053668149270753e-01Q, - 6.97850494793315796932292388026640068e-01Q, - 7.33790062453226804726171131369527646e-01Q, - 7.67777432104826194917977340974503132e-01Q, - 7.99727835821839083013668942322683241e-01Q, - 8.29565762382768397442898119732501916e-01Q, - 8.57205233546061098958658510658943857e-01Q, - 8.82560535792052681543116462530225590e-01Q, - 9.05573307699907798546522558925958320e-01Q, - 9.26200047429274325879324277080474004e-01Q, - 9.44374444748559979415831324037439122e-01Q, - 9.60021864968307512216871025581797663e-01Q, - 9.73116322501126268374693868423706885e-01Q, - 9.83668123279747209970032581605662802e-01Q, - 9.91630996870404594858628366109485725e-01Q, - 9.96893484074649540271630050918695283e-01Q, - 9.99484410050490637571325895705810819e-01Q, + static std::array const & abscissa() + { + static const std::array data = { + static_cast(0.00000000000000000000000000000000000e+00Q), + static_cast(5.14718425553176958330252131667225737e-02Q), + static_cast(1.02806937966737030147096751318000592e-01Q), + static_cast(1.53869913608583546963794672743255920e-01Q), + static_cast(2.04525116682309891438957671002024710e-01Q), + static_cast(2.54636926167889846439805129817805108e-01Q), + static_cast(3.04073202273625077372677107199256554e-01Q), + static_cast(3.52704725530878113471037207089373861e-01Q), + static_cast(4.00401254830394392535476211542660634e-01Q), + static_cast(4.47033769538089176780609900322854000e-01Q), + static_cast(4.92480467861778574993693061207708796e-01Q), + static_cast(5.36624148142019899264169793311072794e-01Q), + static_cast(5.79345235826361691756024932172540496e-01Q), + static_cast(6.20526182989242861140477556431189299e-01Q), + static_cast(6.60061064126626961370053668149270753e-01Q), + static_cast(6.97850494793315796932292388026640068e-01Q), + static_cast(7.33790062453226804726171131369527646e-01Q), + static_cast(7.67777432104826194917977340974503132e-01Q), + static_cast(7.99727835821839083013668942322683241e-01Q), + static_cast(8.29565762382768397442898119732501916e-01Q), + static_cast(8.57205233546061098958658510658943857e-01Q), + static_cast(8.82560535792052681543116462530225590e-01Q), + static_cast(9.05573307699907798546522558925958320e-01Q), + static_cast(9.26200047429274325879324277080474004e-01Q), + static_cast(9.44374444748559979415831324037439122e-01Q), + static_cast(9.60021864968307512216871025581797663e-01Q), + static_cast(9.73116322501126268374693868423706885e-01Q), + static_cast(9.83668123279747209970032581605662802e-01Q), + static_cast(9.91630996870404594858628366109485725e-01Q), + static_cast(9.96893484074649540271630050918695283e-01Q), + static_cast(9.99484410050490637571325895705810819e-01Q), }; return data; } - static std::array<__float128, 31> const & weights() - { - static const std::array<__float128, 31> data = { - 5.14947294294515675583404336470993075e-02Q, - 5.14261285374590259338628792157812598e-02Q, - 5.12215478492587721706562826049442083e-02Q, - 5.08817958987496064922974730498046919e-02Q, - 5.04059214027823468408930856535850289e-02Q, - 4.97956834270742063578115693799423285e-02Q, - 4.90554345550297788875281653672381736e-02Q, - 4.81858617570871291407794922983045926e-02Q, - 4.71855465692991539452614781810994865e-02Q, - 4.60592382710069881162717355593735806e-02Q, - 4.48148001331626631923555516167232438e-02Q, - 4.34525397013560693168317281170732581e-02Q, - 4.19698102151642461471475412859697578e-02Q, - 4.03745389515359591119952797524681142e-02Q, - 3.86789456247275929503486515322810503e-02Q, - 3.68823646518212292239110656171359677e-02Q, - 3.49793380280600241374996707314678751e-02Q, - 3.29814470574837260318141910168539275e-02Q, - 3.09072575623877624728842529430922726e-02Q, - 2.87540487650412928439787853543342111e-02Q, - 2.65099548823331016106017093350754144e-02Q, - 2.41911620780806013656863707252320268e-02Q, - 2.18280358216091922971674857383389934e-02Q, - 1.94141411939423811734089510501284559e-02Q, - 1.69208891890532726275722894203220924e-02Q, - 1.43697295070458048124514324435800102e-02Q, - 1.18230152534963417422328988532505929e-02Q, - 9.27327965951776342844114689202436042e-03Q, - 6.63070391593129217331982636975016813e-03Q, - 3.89046112709988405126720184451550328e-03Q, - 1.38901369867700762455159122675969968e-03Q, + static std::array const & weights() + { + static const std::array data = { + static_cast(5.14947294294515675583404336470993075e-02Q), + static_cast(5.14261285374590259338628792157812598e-02Q), + static_cast(5.12215478492587721706562826049442083e-02Q), + static_cast(5.08817958987496064922974730498046919e-02Q), + static_cast(5.04059214027823468408930856535850289e-02Q), + static_cast(4.97956834270742063578115693799423285e-02Q), + static_cast(4.90554345550297788875281653672381736e-02Q), + static_cast(4.81858617570871291407794922983045926e-02Q), + static_cast(4.71855465692991539452614781810994865e-02Q), + static_cast(4.60592382710069881162717355593735806e-02Q), + static_cast(4.48148001331626631923555516167232438e-02Q), + static_cast(4.34525397013560693168317281170732581e-02Q), + static_cast(4.19698102151642461471475412859697578e-02Q), + static_cast(4.03745389515359591119952797524681142e-02Q), + static_cast(3.86789456247275929503486515322810503e-02Q), + static_cast(3.68823646518212292239110656171359677e-02Q), + static_cast(3.49793380280600241374996707314678751e-02Q), + static_cast(3.29814470574837260318141910168539275e-02Q), + static_cast(3.09072575623877624728842529430922726e-02Q), + static_cast(2.87540487650412928439787853543342111e-02Q), + static_cast(2.65099548823331016106017093350754144e-02Q), + static_cast(2.41911620780806013656863707252320268e-02Q), + static_cast(2.18280358216091922971674857383389934e-02Q), + static_cast(1.94141411939423811734089510501284559e-02Q), + static_cast(1.69208891890532726275722894203220924e-02Q), + static_cast(1.43697295070458048124514324435800102e-02Q), + static_cast(1.18230152534963417422328988532505929e-02Q), + static_cast(9.27327965951776342844114689202436042e-03Q), + static_cast(6.63070391593129217331982636975016813e-03Q), + static_cast(3.89046112709988405126720184451550328e-03Q), + static_cast(1.38901369867700762455159122675969968e-03Q), }; return data; } @@ -1690,7 +1049,7 @@ class gauss_kronrod_detail public: static std::array const & abscissa() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), BOOST_MATH_HUGE_CONSTANT(T, 0, 5.1471842555317695833025213166722573749141453666569564255160843987964755210427109055870090707285485841217089963590678e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.0280693796673703014709675131800059247190133296515840552101946914632788253917872738234797140786490207720254922664913e-01), @@ -1722,12 +1081,12 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9163099687040459485862836610948572485050033374616325510019923349807489603260796605556191495843575227494654783755353e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9689348407464954027163005091869528334088203811775079010809429780238769521016374081588201955806171741257405095963817e-01), BOOST_MATH_HUGE_CONSTANT(T, 0, 9.9948441005049063757132589570581081946887394701850801923632642830748016674843587830656468823145435723317885056396548e-01), - }; + }; // LCOV_EXCL_STOP return data; } static std::array const & weights() { - static std::array data = { + static std::array data = { // LCOV_EXCL_START BOOST_MATH_HUGE_CONSTANT(T, 0, 5.1494729429451567558340433647099307532736880396464168074637323362474083844397567724480716864880173808112573901197920e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 5.1426128537459025933862879215781259829552034862395987263855824172761589259406892072066110681184224608133314131500422e-02), BOOST_MATH_HUGE_CONSTANT(T, 0, 5.1221547849258772170656282604944208251146952425246327553509056805511015401279553971190412722969308620984161625812560e-02), @@ -1759,7 +1118,7 @@ class gauss_kronrod_detail BOOST_MATH_HUGE_CONSTANT(T, 0, 6.6307039159312921733198263697501681336283882177812585973955597357837568277731921327731815844512598157843672104469554e-03), BOOST_MATH_HUGE_CONSTANT(T, 0, 3.8904611270998840512672018445155032785151429848864649214200101281144733676455451061226273655941038347210163533085954e-03), BOOST_MATH_HUGE_CONSTANT(T, 0, 1.3890136986770076245515912267596996810488412919632724534411055332301367130989865366956251556423820479579333920310978e-03), - }; + }; // LCOV_EXCL_STOP return data; } }; diff --git a/test/git_issue_1075.cpp b/test/git_issue_1075.cpp index cf4cba0693..28252d63d4 100644 --- a/test/git_issue_1075.cpp +++ b/test/git_issue_1075.cpp @@ -1,4 +1,4 @@ -// Copyright John Maddock 2017. +// Copyright John Maddock 2024. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) From 549baa5677785b65de3c75e80759a2a2e6757c05 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 3 Feb 2024 18:25:11 +0000 Subject: [PATCH 5/5] Correct gauss method selection logic. --- include/boost/math/quadrature/gauss.hpp | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index e1a5f4bd61..bbe9f19b37 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -30,36 +30,36 @@ struct gauss_constant_category (std::numeric_limits::radix == 2) ? ( #ifdef BOOST_HAS_FLOAT128 - (std::numeric_limits::digits <= 113) && std::is_constructible<__float128, T>::value ? 0 : + (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : #else - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value ? 0 : + (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : #endif - (std::numeric_limits::digits10 <= 110) ? 4 : 999 - ) : (std::numeric_limits::digits10 <= 110) ? 4 : 999; + (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 + ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; using storage_type = - typename std::conditional<(std::numeric_limits::is_specialized == 0), T, - typename std::conditional<(std::numeric_limits::radix == 2), - typename std::conditional< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + std::conditional_t<(std::numeric_limits::is_specialized == 0), T, + std::conditional_t<(std::numeric_limits::radix == 2), + std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), float, - typename std::conditional<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), double, - typename std::conditional<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_convertible::value), + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), long double, #ifdef BOOST_HAS_FLOAT128 - typename std::conditional<((std::numeric_limits::digits <= 113) && std::is_constructible<__float128, T>::value), + std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), __float128, T - >::type - >::type + > + > #else T - >::type + > #endif - >::type - >::type, T - >::type - >::type; + > + >, T + > + >; }; #ifndef BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND