Debian Codegraph @

external/gsl/gsl_specfunc__bessel_I1.c

raw symbols SCIP
1 /* specfunc/bessel_I1.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_bessel.h"cxx . . $ `<file>/external/gsl/gsl_sf_bessel.h`/
26
27 #include "gsl_specfunc__error.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__error.h`/
28
29 #include "gsl_specfunc__chebyshev.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__chebyshev.h`/
30 #include "gsl_specfunc__cheb_eval.c"cxx . . $ `<file>/external/gsl/gsl_specfunc__cheb_eval.c`/
31
32 #define ROOT_EIGHTcxx . . $ `external/gsl/gsl_specfunc__bessel_I1.c:32:9`! (2.0*M_SQRT2cxx . . $ `<external>/11263917310783833665/math.h:1127:10`!)
33
34
35 /*-*-*-*-*-*-*-*-*-*-*-* Private Section *-*-*-*-*-*-*-*-*-*-*-*/
36
37 /* based on SLATEC besi1(), besi1e() */
38
39 /* chebyshev expansions
40
41 series for bi1 on the interval 0. to 9.00000d+00
42 with weighted error 2.40e-17
43 log weighted error 16.62
44 significant figures required 16.23
45 decimal places required 17.14
46
47 series for ai1 on the interval 1.25000d-01 to 3.33333d-01
48 with weighted error 6.98e-17
49 log weighted error 16.16
50 significant figures required 14.53
51 decimal places required 16.82
52
53 series for ai12 on the interval 0. to 1.25000d-01
54 with weighted error 3.55e-17
55 log weighted error 16.45
56 significant figures required 14.69
57 decimal places required 17.12
58 */
59
60 static double bi1_datacxx . . $ bi1_data.[11] = {
61 -0.001971713261099859,
62 0.407348876675464810,
63 0.034838994299959456,
64 0.001545394556300123,
65 0.000041888521098377,
66 0.000000764902676483,
67 0.000000010042493924,
68 0.000000000099322077,
69 0.000000000000766380,
70 0.000000000000004741,
71 0.000000000000000024
72 };
73 static cheb_seriescxx . . $ cheb_series# bi1_cscxx . . $ bi1_cs. = {
74 bi1_datacxx . . $ bi1_data.,
75 10,
76 -1, 1,
77 10
78 };
79
80 static double ai1_datacxx . . $ ai1_data.[21] = {
81 -0.02846744181881479,
82 -0.01922953231443221,
83 -0.00061151858579437,
84 -0.00002069971253350,
85 0.00000858561914581,
86 0.00000104949824671,
87 -0.00000029183389184,
88 -0.00000001559378146,
89 0.00000001318012367,
90 -0.00000000144842341,
91 -0.00000000029085122,
92 0.00000000012663889,
93 -0.00000000001664947,
94 -0.00000000000166665,
95 0.00000000000124260,
96 -0.00000000000027315,
97 0.00000000000002023,
98 0.00000000000000730,
99 -0.00000000000000333,
100 0.00000000000000071,
101 -0.00000000000000006
102 };
103 static cheb_seriescxx . . $ cheb_series# ai1_cscxx . . $ ai1_cs. = {
104 ai1_datacxx . . $ ai1_data.,
105 20,
106 -1, 1,
107 11
108 };
109
110 static double ai12_datacxx . . $ ai12_data.[22] = {
111 0.02857623501828014,
112 -0.00976109749136147,
113 -0.00011058893876263,
114 -0.00000388256480887,
115 -0.00000025122362377,
116 -0.00000002631468847,
117 -0.00000000383538039,
118 -0.00000000055897433,
119 -0.00000000001897495,
120 0.00000000003252602,
121 0.00000000001412580,
122 0.00000000000203564,
123 -0.00000000000071985,
124 -0.00000000000040836,
125 -0.00000000000002101,
126 0.00000000000004273,
127 0.00000000000001041,
128 -0.00000000000000382,
129 -0.00000000000000186,
130 0.00000000000000033,
131 0.00000000000000028,
132 -0.00000000000000003
133 };
134 static cheb_seriescxx . . $ cheb_series# ai12_cscxx . . $ ai12_cs. = {
135 ai12_datacxx . . $ ai12_data.,
136 21,
137 -1, 1,
138 9
139 };
140
141
142 /*-*-*-*-*-*-*-*-*-*-*-* Functions with Error Codes *-*-*-*-*-*-*-*-*-*-*-*/
143
144 int gsl_sf_bessel_I1_scaled_ecxx . . $ gsl_sf_bessel_I1_scaled_e(feafd9287608bc44).(const double x, gsl_sf_resultcxx . . $ gsl_sf_result# * result)
145 {
146 const double xmin = 2.0 * GSL_DBL_MINcxx . . $ `external/gsl/gsl_machine.h:25:9`!;
147 const double x_small = ROOT_EIGHTcxx . . $ `external/gsl/gsl_specfunc__bessel_I1.c:32:9`! * GSL_SQRT_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:18:9`!;
148 const double y = fabscxx . . $ fabs(447c67c6676f75c3).(x);
149
150 /* CHECK_POINTER(result) */
151
152 if(y == 0.0) {
153 result->valcxx . . $ gsl_sf_result_struct#val. = 0.0;
154 result->errcxx . . $ gsl_sf_result_struct#err. = 0.0;
155 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
156 }
157 else if(y < xmin) {
158 UNDERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:3:9`!(result);
159 }
160 else if(y < x_small) {
161 result->valcxx . . $ gsl_sf_result_struct#val. = 0.5*x;
162 result->errcxx . . $ gsl_sf_result_struct#err. = 0.0;
163 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
164 }
165 else if(y <= 3.0) {
166 const double ey = expcxx . . $ exp(447c67c6676f75c3).(-y);
167 gsl_sf_resultcxx . . $ gsl_sf_result# c;
168 cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&bi1_cscxx . . $ bi1_cs., y*y/4.5-1.0, &c);
169 result->valcxx . . $ gsl_sf_result_struct#val. = x * ey * (0.875 + c.valcxx . . $ gsl_sf_result_struct#val.);
170 result->errcxx . . $ gsl_sf_result_struct#err. = ey * c.errcxx . . $ gsl_sf_result_struct#err. + y * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
171 result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
172 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
173 }
174 else if(y <= 8.0) {
175 const double sy = sqrtcxx . . $ sqrt(447c67c6676f75c3).(y);
176 gsl_sf_resultcxx . . $ gsl_sf_result# c;
177 double b;
178 double s;
179 cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&ai1_cscxx . . $ ai1_cs., (48.0/y-11.0)/5.0, &c);
180 b = (0.375 + c.valcxx . . $ gsl_sf_result_struct#val.) / sy;
181 s = (x > 0.0 ? 1.0 : -1.0);
182 result->valcxx . . $ gsl_sf_result_struct#val. = s * b;
183 result->errcxx . . $ gsl_sf_result_struct#err. = c.errcxx . . $ gsl_sf_result_struct#err. / sy;
184 result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
185 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
186 }
187 else {
188 const double sy = sqrtcxx . . $ sqrt(447c67c6676f75c3).(y);
189 gsl_sf_resultcxx . . $ gsl_sf_result# c;
190 double b;
191 double s;
192 cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&ai12_cscxx . . $ ai12_cs., 16.0/y-1.0, &c);
193 b = (0.375 + c.valcxx . . $ gsl_sf_result_struct#val.) / sy;
194 s = (x > 0.0 ? 1.0 : -1.0);
195 result->valcxx . . $ gsl_sf_result_struct#val. = s * b;
196 result->errcxx . . $ gsl_sf_result_struct#err. = c.errcxx . . $ gsl_sf_result_struct#err. / sy;
197 result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
198 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
199 }
200 }
201
202
203 int gsl_sf_bessel_I1_ecxx . . $ gsl_sf_bessel_I1_e(feafd9287608bc44).(const double x, gsl_sf_resultcxx . . $ gsl_sf_result# * result)
204 {
205 const double xmin = 2.0 * GSL_DBL_MINcxx . . $ `external/gsl/gsl_machine.h:25:9`!;
206 const double x_small = ROOT_EIGHTcxx . . $ `external/gsl/gsl_specfunc__bessel_I1.c:32:9`! * GSL_SQRT_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:18:9`!;
207 const double y = fabscxx . . $ fabs(447c67c6676f75c3).(x);
208
209 /* CHECK_POINTER(result) */
210
211 if(y == 0.0) {
212 result->valcxx . . $ gsl_sf_result_struct#val. = 0.0;
213 result->errcxx . . $ gsl_sf_result_struct#err. = 0.0;
214 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
215 }
216 else if(y < xmin) {
217 UNDERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:3:9`!(result);
218 }
219 else if(y < x_small) {
220 result->valcxx . . $ gsl_sf_result_struct#val. = 0.5*x;
221 result->errcxx . . $ gsl_sf_result_struct#err. = 0.0;
222 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
223 }
224 else if(y <= 3.0) {
225 gsl_sf_resultcxx . . $ gsl_sf_result# c;
226 cheb_eval_ecxx . . $ cheb_eval_e(d4bbbe138f497cd3).(&bi1_cscxx . . $ bi1_cs., y*y/4.5-1.0, &c);
227 result->valcxx . . $ gsl_sf_result_struct#val. = x * (0.875 + c.valcxx . . $ gsl_sf_result_struct#val.);
228 result->errcxx . . $ gsl_sf_result_struct#err. = y * c.errcxx . . $ gsl_sf_result_struct#err.;
229 result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
230 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
231 }
232 else if(y < GSL_LOG_DBL_MAXcxx . . $ `external/gsl/gsl_machine.h:39:9`!) {
233 const double ey = expcxx . . $ exp(447c67c6676f75c3).(y);
234 gsl_sf_resultcxx . . $ gsl_sf_result# I1_scaled;
235 gsl_sf_bessel_I1_scaled_ecxx . . $ gsl_sf_bessel_I1_scaled_e(feafd9287608bc44).(x, &I1_scaled);
236 result->valcxx . . $ gsl_sf_result_struct#val. = ey * I1_scaled.valcxx . . $ gsl_sf_result_struct#val.;
237 result->errcxx . . $ gsl_sf_result_struct#err. = ey * I1_scaled.errcxx . . $ gsl_sf_result_struct#err. + y * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
238 result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabscxx . . $ fabs(447c67c6676f75c3).(result->valcxx . . $ gsl_sf_result_struct#val.);
239 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
240 }
241 else {
242 OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`!(result);
243 }
244 }
245
246 /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/
247
248 #include "gsl_specfunc__eval.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__eval.h`/
249
250 double gsl_sf_bessel_I1_scaledcxx . . $ gsl_sf_bessel_I1_scaled(447c67c6676f75c3).(const double x)
251 {
252 EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_bessel_I1_scaled_e(x, &result));
253 }
254
255 double gsl_sf_bessel_I1cxx . . $ gsl_sf_bessel_I1(447c67c6676f75c3).(const double x)
256 {
257 EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_bessel_I1_e(x, &result));
258 }