diff --git a/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp b/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp index 8ed8c8086..5127158b6 100644 --- a/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp +++ b/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp @@ -13,6 +13,8 @@ #include #include +#include +#include #include namespace boost { namespace math { namespace detail { @@ -262,7 +264,7 @@ // We have to be careful when one of the b's crosses the origin: // if(bj.size() > BOOST_MATH_PFQ_MAX_B_TERMS) - policies::raise_domain_error("boost::math::hypergeometric_pFq<%1%>(Seq, Seq, %1%)", + policies::raise_domain_error("boost::math::hypergeometric_pFq<%1%>(Seq, Seq, %1%)", "The number of b terms must be less than the value of BOOST_MATH_PFQ_MAX_B_TERMS (" BOOST_STRINGIZE(BOOST_MATH_PFQ_MAX_B_TERMS) "), but got %1%.", Real(bj.size()), pol); @@ -289,7 +291,7 @@ long long loop_scale = 0; // // loop_error_scale will be used to increase the size of the error - // estimate (absolute sum), based on the errors inherent in calculating + // estimate (absolute sum), based on the errors inherent in calculating // the pochhammer symbols. // Real loop_error_scale = 0; @@ -434,7 +436,7 @@ // abort this part of the series. // trivial_small_series_check = true; - Real d; + Real d; if (loop_scale > local_scaling) { long long rescale = local_scaling - loop_scale; diff --git a/include/boost/math/special_functions/detail/hypergeometric_series.hpp b/include/boost/math/special_functions/detail/hypergeometric_series.hpp index e902498fa..c4915bdcf 100644 --- a/include/boost/math/special_functions/detail/hypergeometric_series.hpp +++ b/include/boost/math/special_functions/detail/hypergeometric_series.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 39287ee89..c74f0f389 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -165,6 +165,7 @@ test-suite special_fun : [ run log1p_expm1_test.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run powm1_sqrtp1m1_test.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run git_issue_705.cpp ../../test/build//boost_unit_test_framework ] + [ run git_issue_810.cpp ../../test/build//boost_unit_test_framework ] [ run special_functions_test.cpp ../../test/build//boost_unit_test_framework ] [ run test_airy.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run test_bessel_j.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] @@ -931,7 +932,7 @@ test-suite misc : ../../test/build//boost_unit_test_framework : : : TEST_LD=1 - [ check-target-builds ../config//has_long_double_support "long double support" : : no ] + [ check-target-builds ../config//has_long_double_support "long double support" : : no ] : test_tr1_long_double ] @@ -953,7 +954,7 @@ test-suite misc : ../../test/build//boost_unit_test_framework : : : TEST_LD=1 - [ check-target-builds ../config//has_long_double_support "long double support" : : no ] + [ check-target-builds ../config//has_long_double_support "long double support" : : no ] : test_tr1_c_long_double ] @@ -1282,7 +1283,7 @@ test-suite quadrature : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : tanh_sinh_quadrature_test_9 ] - [ run tanh_sinh_mpfr.cpp ../tools//mpfr ../tools//gmp : : : [ check-target-builds ../config//has_mpfr : : no ] [ check-target-builds ../config//has_gmp : : no ] [ check-target-builds ../config//is_cygwin_run "Cygwin CI run" : no ] [ requires cxx11_hdr_initializer_list cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] release clang:-Wno-literal-range [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run tanh_sinh_mpfr.cpp ../tools//mpfr ../tools//gmp : : : [ check-target-builds ../config//has_mpfr : : no ] [ check-target-builds ../config//has_gmp : : no ] [ check-target-builds ../config//is_cygwin_run "Cygwin CI run" : no ] [ requires cxx11_hdr_initializer_list cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] release clang:-Wno-literal-range [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run sinh_sinh_quadrature_test.cpp ../../test/build//boost_unit_test_framework : : : release [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] ] [ run exp_sinh_quadrature_test.cpp ../../test/build//boost_unit_test_framework @@ -1444,7 +1445,7 @@ test-suite quadrature : ] [ compile compile_test/quad_naive_monte_carlo_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ] - linux:"-pthread" [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] + linux:"-pthread" [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ 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 ] ] @@ -1518,7 +1519,7 @@ test-suite float128_tests : [ get_float128_tests ] ; # # Things that we can test with exceptions and RTTI turned off: # -alias no_eh_tests : +alias no_eh_tests : compl_abs_incl_test compl_acos_incl_test compl_acosh_incl_test diff --git a/test/git_issue_810.cpp b/test/git_issue_810.cpp new file mode 100644 index 000000000..07748a7fd --- /dev/null +++ b/test/git_issue_810.cpp @@ -0,0 +1,26 @@ +// Copyright Matt Borland, 2022 +// 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 "math_unit_test.hpp" +#include +#include + +template +void test() +{ + T z = -9; + T h = boost::math::hypergeometric_pFq({2,3,4}, {5,6,7,8}, z); // Calculate 3F4 + + // https://www.wolframalpha.com/input?i=HypergeometricPFQ%5B%7B2%2C3%2C4%7D%2C+%7B5%2C6%2C7%2C8%7D%2C-9%5D + CHECK_ULP_CLOSE(h, static_cast(0.8821347263567429637736237739975599147079177547846902085909266074L), 2); +} + +int main(void) +{ + test(); + test(); + + return boost::math::test::report_errors(); +}