test_ibeta_inv_1.cpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 4
  9. #include <boost/math/special_functions/math_fwd.hpp>
  10. #include "libs/math/test/test_ibeta_inv.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. ".*mpfr_float_backend<0>.*", // test type(s)
  22. ".*", // test data group
  23. ".*", 20000000, 1000000); // test function
  24. add_expected_result(
  25. ".*", // compiler
  26. ".*", // stdlib
  27. ".*", // platform
  28. ".*gmp_float<0>.*", // test type(s)
  29. ".*", // test data group
  30. ".*", 20000000, 1000000); // test function
  31. add_expected_result(
  32. ".*", // compiler
  33. ".*", // stdlib
  34. ".*", // platform
  35. ".*mpfr_float_backend<18>.*", // test type(s)
  36. ".*", // test data group
  37. ".*", 50000000, 7000000); // test function
  38. add_expected_result(
  39. ".*", // compiler
  40. ".*", // stdlib
  41. ".*", // platform
  42. ".*", // test type(s)
  43. ".*", // test data group
  44. ".*", 1000000, 100000); // test function
  45. //
  46. // Finish off by printing out the compiler/stdlib/platform names,
  47. // we do this to make it easier to mark up expected error rates.
  48. //
  49. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  50. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  51. }
  52. template <class T>
  53. void test(T t, const char* p)
  54. {
  55. test_beta(t, p);
  56. }
  57. BOOST_AUTO_TEST_CASE(test_main)
  58. {
  59. using namespace boost::multiprecision;
  60. expected_results();
  61. //
  62. // Test at:
  63. // 18 decimal digits: tests 80-bit long double approximations
  64. // 30 decimal digits: tests 128-bit long double approximations
  65. // 35 decimal digits: tests arbitrary precision code
  66. //
  67. ALL_SMALL_TESTS
  68. }