test_carlson_2.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 TEST2
  9. #include <boost/math/special_functions/math_fwd.hpp>
  10. #include "libs/math/test/test_carlson.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<0>.*", // test type(s)
  22. ".*RJ.*", // test data group
  23. ".*", 40000, 4000); // test function
  24. add_expected_result(
  25. ".*", // compiler
  26. ".*", // stdlib
  27. ".*", // platform
  28. ".*gmp_float<0>.*", // test type(s)
  29. ".*RC.*", // test data group
  30. ".*", 7000, 1000); // test function
  31. add_expected_result(
  32. ".*", // compiler
  33. ".*", // stdlib
  34. ".*", // platform
  35. ".*", // test type(s)
  36. ".*RJ.*", // test data group
  37. ".*", 2700, 250); // test function
  38. add_expected_result(
  39. ".*", // compiler
  40. ".*", // stdlib
  41. ".*", // platform
  42. ".*", // test type(s)
  43. ".*", // test data group
  44. ".*", 40, 20); // 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_spots(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_TESTS
  68. }