test_erf_hooks.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #ifndef BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP
  6. #define BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP
  7. #ifdef TEST_NATIVE
  8. namespace other{
  9. inline float erf(float a)
  10. {
  11. return ::erff(a);
  12. }
  13. inline float erfc(float a)
  14. {
  15. return ::erfcf(a);
  16. }
  17. inline double erf(double a)
  18. {
  19. return ::erf(a);
  20. }
  21. inline double erfc(double a)
  22. {
  23. return ::erfc(a);
  24. }
  25. inline long double erf(long double a)
  26. {
  27. return ::erfl(a);
  28. }
  29. inline long double erfc(long double a)
  30. {
  31. return ::erfcl(a);
  32. }
  33. }
  34. #define TEST_OTHER
  35. #endif
  36. #ifdef TEST_CEPHES
  37. namespace other{
  38. extern "C" {
  39. double erf(double);
  40. float erff(float);
  41. long double erfl(long double);
  42. }
  43. inline float erf(float a)
  44. { return erff(a); }
  45. inline long double erf(long double a)
  46. {
  47. #ifdef BOOST_MSVC
  48. return erf((double)a);
  49. #else
  50. return erfl(a);
  51. #endif
  52. }
  53. extern "C" {
  54. double erfc(double);
  55. float erfcf(float);
  56. long double erfcl(long double);
  57. }
  58. inline float erfc(float a)
  59. { return erfcf(a); }
  60. inline long double erfc(long double a)
  61. {
  62. #ifdef BOOST_MSVC
  63. return erfc((double)a);
  64. #else
  65. return erfcl(a);
  66. #endif
  67. }
  68. }
  69. #define TEST_OTHER
  70. #endif
  71. #ifdef TEST_GSL
  72. #include <gsl/gsl_sf_erf.h>
  73. namespace other{
  74. inline float erf(float a)
  75. { return (float)gsl_sf_erf(a); }
  76. inline double erf(double a)
  77. { return gsl_sf_erf(a); }
  78. inline long double erf(long double a)
  79. { return gsl_sf_erf(a); }
  80. inline float erfc(float a)
  81. { return (float)gsl_sf_erfc(a); }
  82. inline double erfc(double a)
  83. { return gsl_sf_erfc(a); }
  84. inline long double erfc(long double a)
  85. { return gsl_sf_erfc(a); }
  86. }
  87. #define TEST_OTHER
  88. #endif
  89. #ifdef TEST_OTHER
  90. namespace other{
  91. boost::math::concepts::real_concept erf(boost::math::concepts::real_concept){ return 0; }
  92. boost::math::concepts::real_concept erfc(boost::math::concepts::real_concept){ return 0; }
  93. }
  94. #endif
  95. #endif