owens_t_example.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Copyright Benjamin Sobotta 2012
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifdef _MSC_VER
  6. # pragma warning(disable : 4127) // conditional expression is constant.
  7. #endif
  8. #include <boost/math/special_functions/owens_t.hpp>
  9. #include <iostream>
  10. int main()
  11. {
  12. double h = 0.0,a;
  13. std::cout << std::setprecision(20);
  14. static const double a_vec[] = {
  15. 0.5000000000000000E+00,
  16. 0.1000000000000000E+01,
  17. 0.2000000000000000E+01,
  18. 0.3000000000000000E+01,
  19. 0.5000000000000000E+00,
  20. 0.1000000000000000E+01,
  21. 0.2000000000000000E+01,
  22. 0.3000000000000000E+01,
  23. 0.5000000000000000E+00,
  24. 0.1000000000000000E+01,
  25. 0.2000000000000000E+01,
  26. 0.3000000000000000E+01,
  27. 0.5000000000000000E+00,
  28. 0.1000000000000000E+01,
  29. 0.2000000000000000E+01,
  30. 0.3000000000000000E+01,
  31. 0.5000000000000000E+00,
  32. 0.1000000000000000E+01,
  33. 0.2000000000000000E+01,
  34. 0.3000000000000000E+01,
  35. 0.1000000000000000E+02,
  36. 0.1000000000000000E+03 };
  37. static const double h_vec[] = {
  38. 0.1000000000000000E+01,
  39. 0.1000000000000000E+01,
  40. 0.1000000000000000E+01,
  41. 0.1000000000000000E+01,
  42. 0.5000000000000000E+00,
  43. 0.5000000000000000E+00,
  44. 0.5000000000000000E+00,
  45. 0.5000000000000000E+00,
  46. 0.2500000000000000E+00,
  47. 0.2500000000000000E+00,
  48. 0.2500000000000000E+00,
  49. 0.2500000000000000E+00,
  50. 0.1250000000000000E+00,
  51. 0.1250000000000000E+00,
  52. 0.1250000000000000E+00,
  53. 0.1250000000000000E+00,
  54. 0.7812500000000000E-02,
  55. 0.7812500000000000E-02,
  56. 0.7812500000000000E-02,
  57. 0.7812500000000000E-02,
  58. 0.7812500000000000E-02,
  59. 0.7812500000000000E-02 };
  60. static const double t_vec[] = {
  61. 0.4306469112078537E-01,
  62. 0.6674188216570097E-01,
  63. 0.7846818699308410E-01,
  64. 0.7929950474887259E-01,
  65. 0.6448860284750376E-01,
  66. 0.1066710629614485E+00,
  67. 0.1415806036539784E+00,
  68. 0.1510840430760184E+00,
  69. 0.7134663382271778E-01,
  70. 0.1201285306350883E+00,
  71. 0.1666128410939293E+00,
  72. 0.1847501847929859E+00,
  73. 0.7317273327500385E-01,
  74. 0.1237630544953746E+00,
  75. 0.1737438887583106E+00,
  76. 0.1951190307092811E+00,
  77. 0.7378938035365546E-01,
  78. 0.1249951430754052E+00,
  79. 0.1761984774738108E+00,
  80. 0.1987772386442824E+00,
  81. 0.2340886964802671E+00,
  82. 0.2479460829231492E+00 };
  83. for(unsigned i = 0; i != 22; ++i)
  84. {
  85. h = h_vec[i];
  86. a = a_vec[i];
  87. const double t = boost::math::owens_t(h, a);
  88. std::cout << "h=" << h << "\ta=" << a << "\tcomp="
  89. << t << "\ttab=" << t_vec[i]
  90. << "\tdiff=" << std::fabs(t_vec[i]-t) << std::endl;;
  91. }
  92. return 0;
  93. }
  94. // EOF