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)
6 #ifndef BOOST_MATH_TEST_GAMMA_OTHER_HOOKS_HPP
7 #define BOOST_MATH_TEST_GAMMA_OTHER_HOOKS_HPP
14 long double gammal(long double);
17 long double lgaml(long double);
18 float igamf(float, float);
19 double igam(double, double);
20 long double igaml(long double, long double);
21 float igamcf(float, float);
22 double igamc(double, double);
23 long double igamcl(long double, long double);
25 inline float tgamma(float x)
27 inline double tgamma(double x)
29 inline long double tgamma(long double x)
32 return gamma((double)x);
37 inline float lgamma(float x)
39 inline double lgamma(double x)
41 inline long double lgamma(long double x)
44 return lgam((double)x);
49 inline float gamma_q(float x, float y)
50 { return igamcf(x, y); }
51 inline double gamma_q(double x, double y)
52 { return igamc(x, y); }
53 inline long double gamma_q(long double x, long double y)
56 return igamc((double)x, (double)y);
61 inline float gamma_p(float x, float y)
62 { return igamf(x, y); }
63 inline double gamma_p(double x, double y)
64 { return igam(x, y); }
65 inline long double gamma_p(long double x, long double y)
68 return igam((double)x, (double)y);
80 #if defined(__FreeBSD__)
82 inline float tgamma(float x)
83 { return ::tgamma(x); }
85 inline float tgamma(float x)
86 { return ::tgammaf(x); }
88 inline double tgamma(double x)
89 { return ::tgamma(x); }
90 inline long double tgamma(long double x)
92 #if defined(__CYGWIN__) || defined(__FreeBSD__)
93 // no long double versions:
99 #if defined(__FreeBSD__)
100 inline float lgamma(float x)
101 { return ::lgamma(x); }
103 inline float lgamma(float x)
104 { return ::lgammaf(x); }
106 inline double lgamma(double x)
107 { return ::lgamma(x); }
108 inline long double lgamma(long double x)
110 #if defined(__CYGWIN__) || defined(__FreeBSD__)
111 // no long double versions:
123 #include <gsl/gsl_sf_gamma.h>
126 float tgamma(float z)
128 return (float)gsl_sf_gamma(z);
130 double tgamma(double z)
132 return gsl_sf_gamma(z);
134 long double tgamma(long double z)
136 return gsl_sf_gamma(z);
138 float lgamma(float z)
140 return (float)gsl_sf_lngamma(z);
142 double lgamma(double z)
144 return gsl_sf_lngamma(z);
146 long double lgamma(long double z)
148 return gsl_sf_lngamma(z);
150 inline float gamma_q(float x, float y)
151 { return (float)gsl_sf_gamma_inc_Q(x, y); }
152 inline double gamma_q(double x, double y)
153 { return gsl_sf_gamma_inc_Q(x, y); }
154 inline long double gamma_q(long double x, long double y)
155 { return gsl_sf_gamma_inc_Q(x, y); }
156 inline float gamma_p(float x, float y)
157 { return (float)gsl_sf_gamma_inc_P(x, y); }
158 inline double gamma_p(double x, double y)
159 { return gsl_sf_gamma_inc_P(x, y); }
160 inline long double gamma_p(long double x, long double y)
161 { return gsl_sf_gamma_inc_P(x, y); }
170 float tgamma(float z)
173 return (float)gamma_x(&v);
175 double tgamma(double z)
179 long double tgamma(long double z)
184 float lgamma(float z)
187 return (float)gamma_log(&v);
189 double lgamma(double z)
192 return gamma_log(&v);
194 long double lgamma(long double z)
197 return gamma_log(&v);
199 inline double gamma_q(double x, double y)
203 gamma_inc (&x, &y, &ans, &qans, &i);
206 inline float gamma_q(float x, float y)
208 return (float)gamma_q((double)x, (double)y);
210 inline long double gamma_q(long double x, long double y)
212 return gamma_q((double)x, (double)y);
214 inline double gamma_p(double x, double y)
218 gamma_inc (&x, &y, &ans, &qans, &i);
221 inline float gamma_p(float x, float y)
223 return (float)gamma_p((double)x, (double)y);
225 inline long double gamma_p(long double x, long double y)
227 return gamma_p((double)x, (double)y);
230 inline double gamma_q_inv(double x, double y)
236 gamma_inc_inv (&x, &ans, &nul, &p, &y, &i);
239 inline float gamma_q_inv(float x, float y)
241 return (float)gamma_q_inv((double)x, (double)y);
243 inline long double gamma_q_inv(long double x, long double y)
245 return gamma_q_inv((double)x, (double)y);
247 inline double gamma_p_inv(double x, double y)
253 gamma_inc_inv (&x, &ans, &nul, &y, &p, &i);
256 inline float gamma_p_inv(float x, float y)
258 return (float)gamma_p_inv((double)x, (double)y);
260 inline long double gamma_p_inv(long double x, long double y)
262 return gamma_p_inv((double)x, (double)y);
270 boost::math::concepts::real_concept tgamma(boost::math::concepts::real_concept){ return 0; }
271 boost::math::concepts::real_concept lgamma(boost::math::concepts::real_concept){ return 0; }
272 boost::math::concepts::real_concept gamma_q(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
273 boost::math::concepts::real_concept gamma_p(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
274 boost::math::concepts::real_concept gamma_p_inv(boost::math::concepts::real_concept x, boost::math::concepts::real_concept y){ return 0; }
275 boost::math::concepts::real_concept gamma_q_inv(boost::math::concepts::real_concept x, boost::math::concepts::real_concept y){ return 0; }