| 1 | /* specfunc/atanint.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_mode.h"cxx . . $ `<file>/external/gsl/gsl_mode.h`/ |
| 26 | #include "gsl_sf_expint.h"cxx . . $ `<file>/external/gsl/gsl_sf_expint.h`/ |
| 27 | |
| 28 | #include "gsl_specfunc__chebyshev.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__chebyshev.h`/ |
| 29 | #include "gsl_specfunc__cheb_eval.c"cxx . . $ `<file>/external/gsl/gsl_specfunc__cheb_eval.c`/ |
| 30 | |
| 31 | |
| 32 | static double atanint_datacxx . . $ atanint_data.[21] = { |
| 33 | 1.91040361296235937512, |
| 34 | -0.4176351437656746940e-01, |
| 35 | 0.275392550786367434e-02, |
| 36 | -0.25051809526248881e-03, |
| 37 | 0.2666981285121171e-04, |
| 38 | -0.311890514107001e-05, |
| 39 | 0.38833853132249e-06, |
| 40 | -0.5057274584964e-07, |
| 41 | 0.681225282949e-08, |
| 42 | -0.94212561654e-09, |
| 43 | 0.13307878816e-09, |
| 44 | -0.1912678075e-10, |
| 45 | 0.278912620e-11, |
| 46 | -0.41174820e-12, |
| 47 | 0.6142987e-13, |
| 48 | -0.924929e-14, |
| 49 | 0.140387e-14, |
| 50 | -0.21460e-15, |
| 51 | 0.3301e-16, |
| 52 | -0.511e-17, |
| 53 | 0.79e-18, |
| 54 | }; |
| 55 | static cheb_seriescxx . . $ cheb_series# atanint_cscxx . . $ atanint_cs. = { |
| 56 | atanint_datacxx . . $ atanint_data., |
| 57 | 20, |
| 58 | -1, 1, |
| 59 | 10 |
| 60 | }; |
| 61 | |
| 62 | |
| 63 | /*-*-*-*-*-*-*-*-*-*-*-* Functions with Error Codes *-*-*-*-*-*-*-*-*-*-*/ |
| 64 | |
| 65 | int |
| 66 | gsl_sf_atanint_ecxx . . $ gsl_sf_atanint_e(feafd9287608bc44).(const double x, gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 67 | { |
| 68 | const double ax = fabs(x); |
| 69 | const double sgn = GSL_SIGNcxx . . $ `external/gsl/gsl_math.h:114:9`!(x); |
| 70 | |
| 71 | /* CHECK_POINTER(result) */ |
| 72 | |
| 73 | if(ax == 0.0) { |
| 74 | result->valcxx . . $ gsl_sf_result_struct#val. = 0.0; |
| 75 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 76 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 77 | } |
| 78 | else if(ax < 0.5*GSL_SQRT_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:18:9`!) { |
| 79 | result->valcxx . . $ gsl_sf_result_struct#val. = x; |
| 80 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 81 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 82 | } |
| 83 | else if(ax <= 1.0) { |
| 84 | const double t = 2.0 * (x*x - 0.5); |
| 85 | gsl_sf_resultcxx . . $ gsl_sf_result# result_c; |
| 86 | cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&atanint_cscxx . . $ atanint_cs., t, &result_c); |
| 87 | result->valcxx . . $ gsl_sf_result_struct#val. = x * result_c.valcxx . . $ gsl_sf_result_struct#val.; |
| 88 | result->errcxx . . $ gsl_sf_result_struct#err. = x * result_c.errcxx . . $ gsl_sf_result_struct#err.; |
| 89 | 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.); |
| 90 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 91 | } |
| 92 | else if(ax < 1.0/GSL_SQRT_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:18:9`!) { |
| 93 | const double t = 2.0 * (1.0/(x*x) - 0.5); |
| 94 | gsl_sf_resultcxx . . $ gsl_sf_result# result_c; |
| 95 | cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&atanint_cscxx . . $ atanint_cs., t, &result_c); |
| 96 | result->valcxx . . $ gsl_sf_result_struct#val. = sgn * (0.5*M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!*log(ax) + result_c.valcxx . . $ gsl_sf_result_struct#val./ax); |
| 97 | result->errcxx . . $ gsl_sf_result_struct#err. = result_c.errcxx . . $ gsl_sf_result_struct#err./ax + fabs(result->valcxx . . $ gsl_sf_result_struct#val.*GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`!); |
| 98 | 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.); |
| 99 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 100 | } |
| 101 | else { |
| 102 | result->valcxx . . $ gsl_sf_result_struct#val. = sgn * 0.5*M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!*log(ax); |
| 103 | result->errcxx . . $ gsl_sf_result_struct#err. = 2.0 * fabs(result->valcxx . . $ gsl_sf_result_struct#val. * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`!); |
| 104 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/ |
| 109 | |
| 110 | #include "gsl_specfunc__eval.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__eval.h`/ |
| 111 | |
| 112 | double gsl_sf_atanintcxx . . $ gsl_sf_atanint(447c67c6676f75c3).(const double x) |
| 113 | { |
| 114 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_atanint_e(x, &result)); |
| 115 | } |