1 // (C) Copyright John Maddock 2006. 2 // Use, modification and distribution are subject to the 3 // Boost Software License, Version 1.0. (See accompanying file 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP 7 #define BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP 8 9 #ifdef TEST_NATIVE 10 namespace other{ erf(float a)11inline float erf(float a) 12 { 13 return ::erff(a); 14 } erfc(float a)15inline float erfc(float a) 16 { 17 return ::erfcf(a); 18 } erf(double a)19inline double erf(double a) 20 { 21 return ::erf(a); 22 } erfc(double a)23inline double erfc(double a) 24 { 25 return ::erfc(a); 26 } erf(long double a)27inline long double erf(long double a) 28 { 29 return ::erfl(a); 30 } erfc(long double a)31inline long double erfc(long double a) 32 { 33 return ::erfcl(a); 34 } 35 } 36 #define TEST_OTHER 37 #endif 38 39 #ifdef TEST_CEPHES 40 namespace other{ 41 extern "C" { 42 double erf(double); 43 float erff(float); 44 long double erfl(long double); 45 } erf(float a)46inline float erf(float a) 47 { return erff(a); } erf(long double a)48inline long double erf(long double a) 49 { 50 #ifdef BOOST_MSVC 51 return erf((double)a); 52 #else 53 return erfl(a); 54 #endif 55 } 56 extern "C" { 57 double erfc(double); 58 float erfcf(float); 59 long double erfcl(long double); 60 } erfc(float a)61inline float erfc(float a) 62 { return erfcf(a); } erfc(long double a)63inline long double erfc(long double a) 64 { 65 #ifdef BOOST_MSVC 66 return erfc((double)a); 67 #else 68 return erfcl(a); 69 #endif 70 } 71 } 72 #define TEST_OTHER 73 #endif 74 75 #ifdef TEST_GSL 76 #include <gsl/gsl_sf_erf.h> 77 78 namespace other{ erf(float a)79inline float erf(float a) 80 { return (float)gsl_sf_erf(a); } erf(double a)81inline double erf(double a) 82 { return gsl_sf_erf(a); } erf(long double a)83inline long double erf(long double a) 84 { return gsl_sf_erf(a); } erfc(float a)85inline float erfc(float a) 86 { return (float)gsl_sf_erfc(a); } erfc(double a)87inline double erfc(double a) 88 { return gsl_sf_erfc(a); } erfc(long double a)89inline long double erfc(long double a) 90 { return gsl_sf_erfc(a); } 91 } 92 #define TEST_OTHER 93 #endif 94 95 #ifdef TEST_OTHER 96 namespace other{ erf(boost::math::concepts::real_concept)97 boost::math::concepts::real_concept erf(boost::math::concepts::real_concept){ return 0; } erfc(boost::math::concepts::real_concept)98 boost::math::concepts::real_concept erfc(boost::math::concepts::real_concept){ return 0; } 99 } 100 #endif 101 102 103 #endif 104 105 106