]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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{ | |
11 | inline float erf(float a) | |
12 | { | |
13 | return ::erff(a); | |
14 | } | |
15 | inline float erfc(float a) | |
16 | { | |
17 | return ::erfcf(a); | |
18 | } | |
19 | inline double erf(double a) | |
20 | { | |
21 | return ::erf(a); | |
22 | } | |
23 | inline double erfc(double a) | |
24 | { | |
25 | return ::erfc(a); | |
26 | } | |
27 | inline long double erf(long double a) | |
28 | { | |
29 | return ::erfl(a); | |
30 | } | |
31 | inline 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 | } | |
46 | inline float erf(float a) | |
47 | { return erff(a); } | |
48 | inline long double erf(long double a) | |
49 | { | |
1e59de90 | 50 | #ifdef _MSC_VER |
7c673cae FG |
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 | } | |
61 | inline float erfc(float a) | |
62 | { return erfcf(a); } | |
63 | inline long double erfc(long double a) | |
64 | { | |
1e59de90 | 65 | #ifdef _MSC_VER |
7c673cae FG |
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{ | |
79 | inline float erf(float a) | |
80 | { return (float)gsl_sf_erf(a); } | |
81 | inline double erf(double a) | |
82 | { return gsl_sf_erf(a); } | |
83 | inline long double erf(long double a) | |
84 | { return gsl_sf_erf(a); } | |
85 | inline float erfc(float a) | |
86 | { return (float)gsl_sf_erfc(a); } | |
87 | inline double erfc(double a) | |
88 | { return gsl_sf_erfc(a); } | |
89 | inline 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{ | |
97 | boost::math::concepts::real_concept erf(boost::math::concepts::real_concept){ return 0; } | |
98 | boost::math::concepts::real_concept erfc(boost::math::concepts::real_concept){ return 0; } | |
99 | } | |
100 | #endif | |
101 | ||
102 | ||
103 | #endif | |
104 | ||
105 |