test_tgamma_ratio.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include <boost/math/special_functions/math_fwd.hpp>
  9. #include "libs/math/test/test_tgamma_ratio.hpp"
  10. void expected_results()
  11. {
  12. //
  13. // Define the max and mean errors expected for
  14. // various compilers and platforms.
  15. //
  16. add_expected_result(
  17. ".*", // compiler
  18. ".*", // stdlib
  19. ".*", // platform
  20. ".*gmp_float<18>.*", // test type(s)
  21. ".*", // test data group
  22. ".*", 4000, 2000); // test function
  23. add_expected_result(
  24. ".*", // compiler
  25. ".*", // stdlib
  26. ".*", // platform
  27. ".*mpfr_float_backend<18>.*", // test type(s)
  28. ".*", // test data group
  29. ".*", 20000, 7000); // test function
  30. add_expected_result(
  31. ".*", // compiler
  32. ".*", // stdlib
  33. ".*", // platform
  34. ".*", // test type(s)
  35. ".*", // test data group
  36. ".*", 2000, 500); // test function
  37. //
  38. // Finish off by printing out the compiler/stdlib/platform names,
  39. // we do this to make it easier to mark up expected error rates.
  40. //
  41. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  42. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  43. }
  44. template <class T>
  45. void test(T t, const char* p)
  46. {
  47. test_tgamma_ratio(t, p);
  48. }
  49. BOOST_AUTO_TEST_CASE(test_main)
  50. {
  51. using namespace boost::multiprecision;
  52. expected_results();
  53. //
  54. // Test at:
  55. // 18 decimal digits: tests 80-bit long double approximations
  56. // 30 decimal digits: tests 128-bit long double approximations
  57. // 35 decimal digits: tests arbitrary precision code
  58. //
  59. ALL_TESTS
  60. }