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/example/owens_t_example.cpp | 113 ++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/boost/libs/math/example/owens_t_example.cpp (limited to 'src/boost/libs/math/example/owens_t_example.cpp') diff --git a/src/boost/libs/math/example/owens_t_example.cpp b/src/boost/libs/math/example/owens_t_example.cpp new file mode 100644 index 00000000..6c6d2041 --- /dev/null +++ b/src/boost/libs/math/example/owens_t_example.cpp @@ -0,0 +1,113 @@ +// Copyright Benjamin Sobotta 2012 + +// 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) + +#ifdef _MSC_VER +# pragma warning(disable : 4127) // conditional expression is constant. +#endif + +#include +#include + +int main() +{ + double h = 0.0,a; + std::cout << std::setprecision(20); + + static const double a_vec[] = { + 0.5000000000000000E+00, + 0.1000000000000000E+01, + 0.2000000000000000E+01, + 0.3000000000000000E+01, + 0.5000000000000000E+00, + 0.1000000000000000E+01, + 0.2000000000000000E+01, + 0.3000000000000000E+01, + 0.5000000000000000E+00, + 0.1000000000000000E+01, + 0.2000000000000000E+01, + 0.3000000000000000E+01, + 0.5000000000000000E+00, + 0.1000000000000000E+01, + 0.2000000000000000E+01, + 0.3000000000000000E+01, + 0.5000000000000000E+00, + 0.1000000000000000E+01, + 0.2000000000000000E+01, + 0.3000000000000000E+01, + 0.1000000000000000E+02, + 0.1000000000000000E+03 }; + + static const double h_vec[] = { + 0.1000000000000000E+01, + 0.1000000000000000E+01, + 0.1000000000000000E+01, + 0.1000000000000000E+01, + 0.5000000000000000E+00, + 0.5000000000000000E+00, + 0.5000000000000000E+00, + 0.5000000000000000E+00, + 0.2500000000000000E+00, + 0.2500000000000000E+00, + 0.2500000000000000E+00, + 0.2500000000000000E+00, + 0.1250000000000000E+00, + 0.1250000000000000E+00, + 0.1250000000000000E+00, + 0.1250000000000000E+00, + 0.7812500000000000E-02, + 0.7812500000000000E-02, + 0.7812500000000000E-02, + 0.7812500000000000E-02, + 0.7812500000000000E-02, + 0.7812500000000000E-02 }; + + static const double t_vec[] = { + 0.4306469112078537E-01, + 0.6674188216570097E-01, + 0.7846818699308410E-01, + 0.7929950474887259E-01, + 0.6448860284750376E-01, + 0.1066710629614485E+00, + 0.1415806036539784E+00, + 0.1510840430760184E+00, + 0.7134663382271778E-01, + 0.1201285306350883E+00, + 0.1666128410939293E+00, + 0.1847501847929859E+00, + 0.7317273327500385E-01, + 0.1237630544953746E+00, + 0.1737438887583106E+00, + 0.1951190307092811E+00, + 0.7378938035365546E-01, + 0.1249951430754052E+00, + 0.1761984774738108E+00, + 0.1987772386442824E+00, + 0.2340886964802671E+00, + 0.2479460829231492E+00 }; + + for(unsigned i = 0; i != 22; ++i) + { + h = h_vec[i]; + a = a_vec[i]; + const double t = boost::math::owens_t(h, a); + std::cout << "h=" << h << "\ta=" << a << "\tcomp=" + << t << "\ttab=" << t_vec[i] + << "\tdiff=" << std::fabs(t_vec[i]-t) << std::endl;; + } + + return 0; +} + + +// EOF + + + + + + + + -- cgit v1.2.3