test_ibeta_2.cpp 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ///////////////////////////////////////////////////////////////
  2. // Copyright 2011 John Maddock. Distributed under the Boost
  3. // Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
  5. #include "setup.hpp"
  6. #include "table_type.hpp"
  7. #define TEST_UDT
  8. #define TEST_DATA 2
  9. #include <boost/math/special_functions/math_fwd.hpp>
  10. #include "libs/math/test/test_ibeta.hpp"
  11. void expected_results()
  12. {
  13. //
  14. // Define the max and mean errors expected for
  15. // various compilers and platforms.
  16. //
  17. add_expected_result(
  18. "[^|]*", // compiler
  19. "[^|]*", // stdlib
  20. "[^|]*", // platform
  21. ".*gmp_float<18>.*", // test type(s)
  22. "(?i).*medium.*", // test data group
  23. ".*", 4000, 1000); // test function
  24. add_expected_result(
  25. "[^|]*", // compiler
  26. "[^|]*", // stdlib
  27. "[^|]*", // platform
  28. ".*mpfr_float_backend<18>.*", // test type(s)
  29. "(?i).*medium.*", // test data group
  30. ".*", 20000, 1000); // test function
  31. add_expected_result(
  32. "[^|]*", // compiler
  33. "[^|]*", // stdlib
  34. "[^|]*", // platform
  35. ".*mpfr_float_backend<0>.*", // test type(s)
  36. "(?i).*medium.*", // test data group
  37. ".*", 400, 100); // test function
  38. add_expected_result(
  39. "[^|]*", // compiler
  40. "[^|]*", // stdlib
  41. "[^|]*", // platform
  42. ".*", // test type(s)
  43. "(?i).*small.*", // test data group
  44. ".*", 90, 25); // test function
  45. #ifdef BOOST_INTEL
  46. add_expected_result(
  47. "[^|]*", // compiler
  48. "[^|]*", // stdlib
  49. "[^|]*", // platform
  50. "float128", // test type(s)
  51. "(?i).*medium.*", // test data group
  52. ".*", 5000, 500); // test function
  53. #endif
  54. add_expected_result(
  55. "[^|]*", // compiler
  56. "[^|]*", // stdlib
  57. "[^|]*", // platform
  58. ".*", // test type(s)
  59. "(?i).*medium.*", // test data group
  60. ".*", 220, 50); // test function
  61. add_expected_result(
  62. "[^|]*", // compiler
  63. "[^|]*", // stdlib
  64. "[^|]*", // platform
  65. ".*", // test type(s)
  66. "(?i).*large.*", // test data group
  67. ".*", 5000, 500); // test function
  68. //
  69. // Finish off by printing out the compiler/stdlib/platform names,
  70. // we do this to make it easier to mark up expected error rates.
  71. //
  72. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  73. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  74. }
  75. template <class T>
  76. void test(T t, const char* p)
  77. {
  78. test_beta(t, p);
  79. }
  80. BOOST_AUTO_TEST_CASE(test_main)
  81. {
  82. using namespace boost::multiprecision;
  83. expected_results();
  84. //
  85. // Test at:
  86. // 18 decimal digits: tests 80-bit long double approximations
  87. // 30 decimal digits: tests 128-bit long double approximations
  88. // 35 decimal digits: tests arbitrary precision code
  89. //
  90. ALL_TESTS
  91. }