test_ibeta_3.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 3
  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. ".*", // test type(s)
  22. "(?i).*small.*", // test data group
  23. ".*", 90, 25); // test function
  24. add_expected_result(
  25. "[^|]*", // compiler
  26. "[^|]*", // stdlib
  27. "[^|]*", // platform
  28. ".*", // test type(s)
  29. "(?i).*medium.*", // test data group
  30. ".*", 200, 50); // test function
  31. add_expected_result(
  32. "[^|]*", // compiler
  33. "[^|]*", // stdlib
  34. "[^|]*", // platform
  35. ".*", // test type(s)
  36. "(?i).*large.*", // test data group
  37. ".*", 6000000, 500000); // test function
  38. //
  39. // Finish off by printing out the compiler/stdlib/platform names,
  40. // we do this to make it easier to mark up expected error rates.
  41. //
  42. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  43. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  44. }
  45. template <class T>
  46. void test(T t, const char* p)
  47. {
  48. test_beta(t, p);
  49. }
  50. BOOST_AUTO_TEST_CASE(test_main)
  51. {
  52. using namespace boost::multiprecision;
  53. expected_results();
  54. //
  55. // Test at:
  56. // 18 decimal digits: tests 80-bit long double approximations
  57. // 30 decimal digits: tests 128-bit long double approximations
  58. // 35 decimal digits: tests arbitrary precision code
  59. //
  60. ALL_TESTS
  61. }