test_ellint_3.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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_ellint_3.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. ".*", 3000, 500); // 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. ".*", 10000, 3000); // test function
  30. add_expected_result(
  31. ".*", // compiler
  32. ".*", // stdlib
  33. ".*", // platform
  34. ".*mpfr_float_backend<0>.*", // test type(s)
  35. ".*Mathworld.*", // test data group
  36. ".*", 10000, 3000); // test function
  37. add_expected_result(
  38. ".*", // compiler
  39. ".*", // stdlib
  40. ".*", // platform
  41. ".*gmp_float<0>.*", // test type(s)
  42. ".*", // test data group
  43. ".*", 10000, 1200); // test function
  44. add_expected_result(
  45. ".*", // compiler
  46. ".*", // stdlib
  47. ".*", // platform
  48. ".*", // test type(s)
  49. ".*Large.*", // test data group
  50. ".*", 75, 40); // test function
  51. add_expected_result(
  52. ".*", // compiler
  53. ".*", // stdlib
  54. ".*", // platform
  55. ".*cpp_bin_float_quad.*", // test type(s)
  56. ".*Mathworld.*", // test data group
  57. ".*", 500, 100); // test function
  58. #ifdef BOOST_INTEL
  59. add_expected_result(
  60. ".*", // compiler
  61. ".*", // stdlib
  62. ".*", // platform
  63. ".*float128.*", // test type(s)
  64. ".*", // test data group
  65. ".*", 200, 30); // test function
  66. #endif
  67. add_expected_result(
  68. ".*", // compiler
  69. ".*", // stdlib
  70. ".*", // platform
  71. ".*", // test type(s)
  72. ".*Mathworld.*", // test data group
  73. ".*", 600, 300); // test function
  74. add_expected_result(
  75. ".*", // compiler
  76. ".*", // stdlib
  77. ".*", // platform
  78. ".*", // test type(s)
  79. ".*", // test data group
  80. ".*", 60, 30); // test function
  81. //
  82. // Finish off by printing out the compiler/stdlib/platform names,
  83. // we do this to make it easier to mark up expected error rates.
  84. //
  85. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  86. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  87. }
  88. template <class T>
  89. void test(T t, const char* p)
  90. {
  91. test_spots(t, p);
  92. }
  93. BOOST_AUTO_TEST_CASE(test_main)
  94. {
  95. using namespace boost::multiprecision;
  96. expected_results();
  97. //
  98. // Test at:
  99. // 18 decimal digits: tests 80-bit long double approximations
  100. // 30 decimal digits: tests 128-bit long double approximations
  101. // 35 decimal digits: tests arbitrary precision code
  102. //
  103. ALL_TESTS
  104. }