// 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) #include #include #include template void test() { auto f = [](const T& x){ return exp(-x * x / 2); }; T error = 0; 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(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; 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(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; 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(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); std::cout << r << std::endl; r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); std::cout << r << std::endl; r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); std::cout << r << std::endl; r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); std::cout << r << std::endl; r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); std::cout << r << std::endl; } int main() { test(); test(); test(); using strange = boost::multiprecision::number, boost::multiprecision::et_off>; test(); return 0; }