| 1 | /* specfunc/hyperg_2F0.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman |
| 4 | * |
| 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. |
| 9 | * |
| 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. |
| 14 | * |
| 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. |
| 18 | */ |
| 19 | |
| 20 | /* Author: G. Jungman */ |
| 21 | |
| 22 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 23 | #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/ |
| 24 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 25 | #include "gsl_sf_hyperg.h"cxx . . $ `<file>/external/gsl/gsl_sf_hyperg.h`/ |
| 26 | |
| 27 | #include "gsl_specfunc__error.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__error.h`/ |
| 28 | #include "gsl_specfunc__hyperg.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__hyperg.h`/ |
| 29 | |
| 30 | int |
| 31 | gsl_sf_hyperg_2F0_ecxx . . $ gsl_sf_hyperg_2F0_e(aa5d4b97d4e04b77).(const double a, const double b, const double x, gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 32 | { |
| 33 | if(x < 0.0) { |
| 34 | /* Use "definition" 2F0(a,b,x) = (-1/x)^a U(a,1+a-b,-1/x). |
| 35 | */ |
| 36 | gsl_sf_resultcxx . . $ gsl_sf_result# U; |
| 37 | double pre = pow(-1.0/x, a); |
| 38 | int stat_U = gsl_sf_hyperg_U_ecxx . . $ gsl_sf_hyperg_U_e(aa5d4b97d4e04b77).(a, 1.0+a-b, -1.0/x, &U); |
| 39 | result->valcxx . . $ gsl_sf_result_struct#val. = pre * U.valcxx . . $ gsl_sf_result_struct#val.; |
| 40 | result->errcxx . . $ gsl_sf_result_struct#err. = GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabs(result->valcxx . . $ gsl_sf_result_struct#val.) + pre * U.errcxx . . $ gsl_sf_result_struct#err.; |
| 41 | return stat_U; |
| 42 | } |
| 43 | else if(x == 0.0) { |
| 44 | result->valcxx . . $ gsl_sf_result_struct#val. = 1.0; |
| 45 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 46 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 47 | } |
| 48 | else { |
| 49 | /* Use asymptotic series. ?? |
| 50 | */ |
| 51 | /* return hyperg_2F0_series(a, b, x, -1, result, &prec); */ |
| 52 | DOMAIN_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:9:9`!(result); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/ |
| 57 | |
| 58 | #include "gsl_specfunc__eval.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__eval.h`/ |
| 59 | |
| 60 | double gsl_sf_hyperg_2F0cxx . . $ gsl_sf_hyperg_2F0(7678bba071383ab).(const double a, const double b, const double x) |
| 61 | { |
| 62 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_hyperg_2F0_e(a, b, x, &result)); |
| 63 | } |