Debian Codegraph @

external/gsl/gsl_specfunc__bessel_J0.c

raw symbols SCIP
1 /* specfunc/bessel_J0.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_specfunc__bessel.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__bessel.h`/
27 #include "gsl_specfunc__bessel_amp_phase.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__bessel_amp_phase.h`/
28 #include "gsl_sf_trig.h"cxx . . $ `<file>/external/gsl/gsl_sf_trig.h`/
29 #include "gsl_sf_bessel.h"cxx . . $ `<file>/external/gsl/gsl_sf_bessel.h`/
30
31 #include "gsl_specfunc__cheb_eval.c"cxx . . $ `<file>/external/gsl/gsl_specfunc__cheb_eval.c`/
32
33 /*-*-*-*-*-*-*-*-*-*-*-* Private Section *-*-*-*-*-*-*-*-*-*-*-*/
34
35
36 /* based on SLATEC besj0, 1977 version, w. fullerton */
37
38 /* chebyshev expansions for Bessel functions
39
40 series for bj0 on the interval 0. to 1.60000d+01
41 with weighted error 7.47e-18
42 log weighted error 17.13
43 significant figures required 16.98
44 decimal places required 17.68
45
46 */
47
48 static double bj0_datacxx . . $ bj0_data.[13] = {
49 0.100254161968939137,
50 -0.665223007764405132,
51 0.248983703498281314,
52 -0.0332527231700357697,
53 0.0023114179304694015,
54 -0.0000991127741995080,
55 0.0000028916708643998,
56 -0.0000000612108586630,
57 0.0000000009838650793,
58 -0.0000000000124235515,
59 0.0000000000001265433,
60 -0.0000000000000010619,
61 0.0000000000000000074,
62 };
63 static cheb_seriescxx . . $ cheb_series# bj0_cscxx . . $ bj0_cs. = {
64 bj0_datacxx . . $ bj0_data.,
65 12,
66 -1, 1,
67 9
68 };
69
70
71 /*-*-*-*-*-*-*-*-*-*-*-* Functions with Error Codes *-*-*-*-*-*-*-*-*-*-*-*/
72
73 int gsl_sf_bessel_J0_ecxx . . $ gsl_sf_bessel_J0_e(feafd9287608bc44).(const double x, gsl_sf_resultcxx . . $ gsl_sf_result# * result)
74 {
75 double y = fabs(x);
76
77 /* CHECK_POINTER(result) */
78
79 if(y < 2.0*GSL_SQRT_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:18:9`!) {
80 result->valcxx . . $ gsl_sf_result_struct#val. = 1.0;
81 result->errcxx . . $ gsl_sf_result_struct#err. = y*y;
82 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
83 }
84 else if(y <= 4.0) {
85 return cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&bj0_cscxx . . $ bj0_cs., 0.125*y*y - 1.0, result);
86 }
87 else {
88 const double z = 32.0/(y*y) - 1.0;
89 gsl_sf_resultcxx . . $ gsl_sf_result# ca;
90 gsl_sf_resultcxx . . $ gsl_sf_result# ct;
91 gsl_sf_resultcxx . . $ gsl_sf_result# cp;
92 const int stat_ca = cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&_gsl_sf_bessel_amp_phase_bm0_cscxx . . $ _gsl_sf_bessel_amp_phase_bm0_cs., z, &ca);
93 const int stat_ct = cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&_gsl_sf_bessel_amp_phase_bth0_cscxx . . $ _gsl_sf_bessel_amp_phase_bth0_cs., z, &ct);
94 const int stat_cp = gsl_sf_bessel_cos_pi4_ecxx . . $ gsl_sf_bessel_cos_pi4_e(38fedf92a6b14b51).(y, ct.valcxx . . $ gsl_sf_result_struct#val./y, &cp);
95 const double sqrty = sqrt(y);
96 const double ampl = (0.75 + ca.valcxx . . $ gsl_sf_result_struct#val.) / sqrty;
97 result->valcxx . . $ gsl_sf_result_struct#val. = ampl * cp.valcxx . . $ gsl_sf_result_struct#val.;
98 result->errcxx . . $ gsl_sf_result_struct#err. = fabs(cp.valcxx . . $ gsl_sf_result_struct#val.) * ca.errcxx . . $ gsl_sf_result_struct#err./sqrty + fabs(ampl) * cp.errcxx . . $ gsl_sf_result_struct#err.;
99 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.);
100 return GSL_ERROR_SELECT_3cxx . . $ `external/gsl/gsl_errno.h:146:9`!(stat_ca, stat_ct, stat_cp);
101 }
102 }
103
104 /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/
105
106 #include "gsl_specfunc__eval.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__eval.h`/
107
108 double gsl_sf_bessel_J0cxx . . $ gsl_sf_bessel_J0(447c67c6676f75c3).(const double x)
109 {
110 EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_bessel_J0_e(x, &result));
111 }