test_erf.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 http://www.boost.org/LICENSE_1_
  5. #include "setup.hpp"
  6. #include "table_type.hpp"
  7. #define TEST_UDT
  8. #include <boost/math/special_functions/erf.hpp>
  9. #include "libs/math/test/test_erf.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. ".*", // test type(s)
  21. "Erf Function:.*", // test data group
  22. "erfc?", 2500, 1000); // test function
  23. add_expected_result(
  24. ".*", // compiler
  25. ".*", // stdlib
  26. ".*", // platform
  27. ".*", // test type(s)
  28. "Inverse Erf.*", // test data group
  29. "erfc?_inv", 60, 20); // test function
  30. //
  31. // Finish off by printing out the compiler/stdlib/platform names,
  32. // we do this to make it easier to mark up expected error rates.
  33. //
  34. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  35. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  36. }
  37. template <class T>
  38. void test(T t, const char* p)
  39. {
  40. test_erf(t, p);
  41. }
  42. BOOST_AUTO_TEST_CASE( test_main )
  43. {
  44. expected_results();
  45. //
  46. // Test at:
  47. // 18 decimal digits: tests 80-bit long double approximations
  48. // 30 decimal digits: tests 128-bit long double approximations
  49. // 35 decimal digits: tests arbitrary precision code
  50. //
  51. ALL_TESTS
  52. }