1 /* specfunc/hyperg_2F0.c
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /* Author: G. Jungman */
23 #include <gsl/gsl_math.h>
24 #include <gsl/gsl_errno.h>
25 #include <gsl/gsl_sf_hyperg.h>
31 gsl_sf_hyperg_2F0_e(const double a, const double b, const double x, gsl_sf_result * result)
34 /* Use "definition" 2F0(a,b,x) = (-1/x)^a U(a,1+a-b,-1/x).
37 double pre = pow(-1.0/x, a);
38 int stat_U = gsl_sf_hyperg_U_e(a, 1.0+a-b, -1.0/x, &U);
39 result->val = pre * U.val;
40 result->err = GSL_DBL_EPSILON * fabs(result->val) + pre * U.err;
49 /* Use asymptotic series. ??
51 /* return hyperg_2F0_series(a, b, x, -1, result, &prec); */
56 /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/
60 double gsl_sf_hyperg_2F0(const double a, const double b, const double x)
62 EVAL_RESULT(gsl_sf_hyperg_2F0_e(a, b, x, &result));