test_carlson_1.cpp 2.6 KB

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