test_hermite.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_hermite.hpp"
  10. void expected_results()
  11. {
  12. //
  13. // Define the max and mean errors expected for
  14. // various compilers and platforms.
  15. //
  16. #ifdef BOOST_INTEL
  17. add_expected_result(
  18. ".*", // compiler
  19. ".*", // stdlib
  20. ".*", // platform
  21. "float128", // test type(s)
  22. ".*", // test data group
  23. "hermite", 70, 25); // test function
  24. #endif
  25. add_expected_result(
  26. ".*", // compiler
  27. ".*", // stdlib
  28. ".*", // platform
  29. ".*", // test type(s)
  30. ".*", // test data group
  31. "hermite", 10, 5); // test function
  32. //
  33. // Finish off by printing out the compiler/stdlib/platform names,
  34. // we do this to make it easier to mark up expected error rates.
  35. //
  36. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  37. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  38. }
  39. template <class T>
  40. void test(T t, const char* p)
  41. {
  42. test_hermite(t, p);
  43. }
  44. BOOST_AUTO_TEST_CASE(test_main)
  45. {
  46. using namespace boost::multiprecision;
  47. expected_results();
  48. //
  49. // Test at:
  50. // 18 decimal digits: tests 80-bit long double approximations
  51. // 30 decimal digits: tests 128-bit long double approximations
  52. // 35 decimal digits: tests arbitrary precision code
  53. //
  54. ALL_TESTS
  55. }