From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/math/test/test_1F1_regularized.hpp | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/boost/libs/math/test/test_1F1_regularized.hpp (limited to 'src/boost/libs/math/test/test_1F1_regularized.hpp') diff --git a/src/boost/libs/math/test/test_1F1_regularized.hpp b/src/boost/libs/math/test/test_1F1_regularized.hpp new file mode 100644 index 00000000..7655d427 --- /dev/null +++ b/src/boost/libs/math/test/test_1F1_regularized.hpp @@ -0,0 +1,77 @@ +// Copyright John Maddock 2006. +// Copyright Paul A. Bristow 2007, 2009 +// 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) + +#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error + +#include +#include +#define BOOST_TEST_MAIN +#include +#include +#include +#include +#include +#include +#include +#include +#include "functor.hpp" + +#include "handle_test_result.hpp" +#include "table_type.hpp" + +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(disable:4127) +#endif + +template +void do_test_1F1(const T& data, const char* type_name, const char* test_name) +{ + typedef Real value_type; + + typedef value_type(*pg)(value_type, value_type, value_type); +#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS) + pg funcp = boost::math::hypergeometric_0F1_regularized; +#else + pg funcp = boost::math::hypergeometric_1F1_regularized; +#endif + + boost::math::tools::test_result result; + + std::cout << "Testing " << test_name << " with type " << type_name + << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; + + // + // test hypergeometric_2F0 against data: + // + result = boost::math::tools::test_hetero( + data, + bind_func(funcp, 0, 1, 2), + extract_result(3)); + handle_test_result(result, data[result.worst()], result.worst(), type_name, "hypergeometric_1F1_regularized", test_name); + std::cout << std::endl; +} + +#ifndef SC_ +#define SC_(x) BOOST_MATH_BIG_CONSTANT(T, 1000000, x) +#endif + +template +void test_spots1(T, const char* type_name) +{ +#include "hypergeometric_1f1_large_regularized.ipp" + + do_test_1F1(hypergeometric_1f1_large_regularized, type_name, "Large random values - regularized"); +} + +template +void test_spots(T z, const char* type_name) +{ + test_spots1(z, type_name); +} + -- cgit v1.2.3