/////////////////////////////////////////////////////////////// // Copyright 2011 John Maddock. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ #ifdef _MSC_VER # define _SCL_SECURE_NO_WARNINGS #endif #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50) # define TEST_MPF_50 # define TEST_MPFR_50 # define TEST_CPP_DEC_FLOAT #ifdef _MSC_VER #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!") #endif #ifdef __GNUC__ #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!" #endif #endif #if defined(TEST_MPF_50) #include #endif #if defined(TEST_MPFR_50) #include #endif #ifdef TEST_BACKEND #include #endif #ifdef TEST_CPP_DEC_FLOAT #include #endif #define SC_(x) BOOST_STRINGIZE(x) #define TEST_UDT #include #include "libs/math/test/test_erf.hpp" void expected_results() { // // Define the max and mean errors expected for // various compilers and platforms. // add_expected_result( ".*", // compiler ".*", // stdlib ".*", // platform ".*gmp_float<18>.*", // test type(s) "Erf Function:.*", // test data group "boost::math::erfc?", 2200, 1500);// test function add_expected_result( ".*", // compiler ".*", // stdlib ".*", // platform ".*gmp_float<18>.*", // test type(s) "Inverse Erf.*", // test data group "boost::math::erfc?_inv", 2200, 1500); // test function add_expected_result( ".*", // compiler ".*", // stdlib ".*", // platform ".*", // test type(s) "Erf Function:.*", // test data group "boost::math::erfc?", 300, 200); // test function add_expected_result( ".*", // compiler ".*", // stdlib ".*", // platform ".*", // test type(s) "Inverse Erf.*", // test data group "boost::math::erfc?_inv", 35, 20); // test function // // Finish off by printing out the compiler/stdlib/platform names, // we do this to make it easier to mark up expected error rates. // std::cout << "Tests run with " << BOOST_COMPILER << ", " << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; } int test_main(int, char* []) { using namespace boost::multiprecision; expected_results(); // // Test at: // 18 decimal digits: tests 80-bit long double approximations // 30 decimal digits: tests 128-bit long double approximations // 35 decimal digits: tests arbitrary precision code // #ifdef TEST_MPF_50 test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); #endif #ifdef TEST_MPFR_50 test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); #endif #ifdef TEST_CPP_DEC_FLOAT test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); test_erf(mp_number >(), "mp_number >"); #endif return 0; }