WSJT-X/boost/libs/math/example/owens_t_example.cpp

114 lines
2.7 KiB
C++

// 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 <boost/math/special_functions/owens_t.hpp>
#include <iostream>
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