test_igamma_inv.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_igamma_inv.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. ".*small.*", // test data group
  22. ".*", 2000000000L, 300000000L); // test function
  23. add_expected_result(
  24. ".*", // compiler
  25. ".*", // stdlib
  26. ".*", // platform
  27. ".*mpfr_float_backend<18>.*", // test type(s)
  28. ".*small.*", // test data group
  29. ".*", 30000000L, 20000000L); // test function
  30. add_expected_result(
  31. ".*", // compiler
  32. ".*", // stdlib
  33. ".*", // platform
  34. ".*", // test type(s)
  35. ".*small.*", // test data group
  36. ".*", 10000000L, 2500000L); // test function
  37. add_expected_result(
  38. ".*", // compiler
  39. ".*", // stdlib
  40. ".*", // platform
  41. ".*", // test type(s)
  42. ".*", // test data group
  43. ".*", 7000, 2000); // test function
  44. //
  45. // Finish off by printing out the compiler/stdlib/platform names,
  46. // we do this to make it easier to mark up expected error rates.
  47. //
  48. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  49. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  50. }
  51. template <class T>
  52. void test(T t, const char* p)
  53. {
  54. test_gamma(t, p);
  55. }
  56. BOOST_AUTO_TEST_CASE(test_main)
  57. {
  58. using namespace boost::multiprecision;
  59. expected_results();
  60. //
  61. // Test at:
  62. // 18 decimal digits: tests 80-bit long double approximations
  63. // 30 decimal digits: tests 128-bit long double approximations
  64. // 35 decimal digits: tests arbitrary precision code
  65. //
  66. ALL_TESTS
  67. }