PageRenderTime 53ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/Miranda IM - CK Release/Miranda/boost/libs/math/example/owens_t_example.cpp

http://miranda-dev.googlecode.com/
C++ | 109 lines | 86 code | 18 blank | 5 comment | 2 complexity | 18ae42b92b26dfb808533fea551a3acf MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, LGPL-3.0, AGPL-1.0, BSD-3-Clause, LGPL-2.1
  1. // (C) 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. #include <boost/math/special_functions/owens_t.hpp>
  6. #include <iostream>
  7. int main()
  8. {
  9. double h = 0.0,a;
  10. std::cout << std::setprecision(20);
  11. static const double a_vec[] = {
  12. 0.5000000000000000E+00,
  13. 0.1000000000000000E+01,
  14. 0.2000000000000000E+01,
  15. 0.3000000000000000E+01,
  16. 0.5000000000000000E+00,
  17. 0.1000000000000000E+01,
  18. 0.2000000000000000E+01,
  19. 0.3000000000000000E+01,
  20. 0.5000000000000000E+00,
  21. 0.1000000000000000E+01,
  22. 0.2000000000000000E+01,
  23. 0.3000000000000000E+01,
  24. 0.5000000000000000E+00,
  25. 0.1000000000000000E+01,
  26. 0.2000000000000000E+01,
  27. 0.3000000000000000E+01,
  28. 0.5000000000000000E+00,
  29. 0.1000000000000000E+01,
  30. 0.2000000000000000E+01,
  31. 0.3000000000000000E+01,
  32. 0.1000000000000000E+02,
  33. 0.1000000000000000E+03 };
  34. static const double h_vec[] = {
  35. 0.1000000000000000E+01,
  36. 0.1000000000000000E+01,
  37. 0.1000000000000000E+01,
  38. 0.1000000000000000E+01,
  39. 0.5000000000000000E+00,
  40. 0.5000000000000000E+00,
  41. 0.5000000000000000E+00,
  42. 0.5000000000000000E+00,
  43. 0.2500000000000000E+00,
  44. 0.2500000000000000E+00,
  45. 0.2500000000000000E+00,
  46. 0.2500000000000000E+00,
  47. 0.1250000000000000E+00,
  48. 0.1250000000000000E+00,
  49. 0.1250000000000000E+00,
  50. 0.1250000000000000E+00,
  51. 0.7812500000000000E-02,
  52. 0.7812500000000000E-02,
  53. 0.7812500000000000E-02,
  54. 0.7812500000000000E-02,
  55. 0.7812500000000000E-02,
  56. 0.7812500000000000E-02 };
  57. static const double t_vec[] = {
  58. 0.4306469112078537E-01,
  59. 0.6674188216570097E-01,
  60. 0.7846818699308410E-01,
  61. 0.7929950474887259E-01,
  62. 0.6448860284750376E-01,
  63. 0.1066710629614485E+00,
  64. 0.1415806036539784E+00,
  65. 0.1510840430760184E+00,
  66. 0.7134663382271778E-01,
  67. 0.1201285306350883E+00,
  68. 0.1666128410939293E+00,
  69. 0.1847501847929859E+00,
  70. 0.7317273327500385E-01,
  71. 0.1237630544953746E+00,
  72. 0.1737438887583106E+00,
  73. 0.1951190307092811E+00,
  74. 0.7378938035365546E-01,
  75. 0.1249951430754052E+00,
  76. 0.1761984774738108E+00,
  77. 0.1987772386442824E+00,
  78. 0.2340886964802671E+00,
  79. 0.2479460829231492E+00 };
  80. for(unsigned i = 0; i != 22; ++i)
  81. {
  82. h = h_vec[i];
  83. a = a_vec[i];
  84. const double t = boost::math::owens_t(h, a);
  85. std::cout << "h=" << h << "\ta=" << a << "\tcomp="
  86. << t << "\ttab=" << t_vec[i]
  87. << "\tdiff=" << std::fabs(t_vec[i]-t) << std::endl;;
  88. }
  89. return 0;
  90. }
  91. // EOF