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/sinhc_test.hpp | 92 +++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 src/boost/libs/math/test/sinhc_test.hpp (limited to 'src/boost/libs/math/test/sinhc_test.hpp') diff --git a/src/boost/libs/math/test/sinhc_test.hpp b/src/boost/libs/math/test/sinhc_test.hpp new file mode 100644 index 00000000..b50bd2e6 --- /dev/null +++ b/src/boost/libs/math/test/sinhc_test.hpp @@ -0,0 +1,92 @@ +// unit test file sinhc.hpp for the special functions test suite + +// (C) Copyright Hubert Holin 2003. +// Distributed under 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 +#include + + +#include + +#define BOOST_TEST_MAIN +#include + + +BOOST_TEST_CASE_TEMPLATE_FUNCTION(sinhc_pi_test, T) +{ + using ::std::abs; + + using ::std::numeric_limits; + + using ::boost::math::sinhc_pi; + + + BOOST_TEST_MESSAGE("Testing sinhc_pi in the real domain for " + << string_type_name::_() << "."); + + BOOST_CHECK_PREDICATE(::std::less_equal(), + (abs(sinhc_pi(static_cast(0))-static_cast(1))) + (numeric_limits::epsilon())); +} + + +BOOST_TEST_CASE_TEMPLATE_FUNCTION(sinhc_pi_complex_test, T) +{ + using ::std::abs; + using ::std::sin; + + using ::std::numeric_limits; + + using ::boost::math::sinhc_pi; + + + BOOST_TEST_MESSAGE("Testing sinhc_pi in the complex domain for " + << string_type_name::_() << "."); + + BOOST_CHECK_PREDICATE(::std::less_equal(), + (abs(sinhc_pi(::std::complex(0, 1))- + ::std::complex(sin(static_cast(1))))) + (numeric_limits::epsilon())); +} + + +void sinhc_pi_manual_check() +{ + using ::boost::math::sinhc_pi; + + + BOOST_TEST_MESSAGE(" "); + BOOST_TEST_MESSAGE("sinc_pi"); + + for (int i = 0; i <= 100; i++) + { +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + BOOST_TEST_MESSAGE( ::std::setw(15) + << sinhc_pi(static_cast(i-50)/ + static_cast(50)) + << ::std::setw(15) + << sinhc_pi(static_cast(i-50)/ + static_cast(50)) + << ::std::setw(15) + << sinhc_pi(static_cast(i-50)/ + static_cast(50))); +#else + BOOST_TEST_MESSAGE( ::std::setw(15) + << sinhc_pi(static_cast(i-50)/ + static_cast(50)) + << ::std::setw(15) + << sinhc_pi(static_cast(i-50)/ + static_cast(50))); +#endif + } + + BOOST_TEST_MESSAGE(" "); +} + + -- cgit v1.2.3