17 double xx,y,ans,ans1,ans2;
18 if ((ax=
fabs(x)) < 8.0) {
20 ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7+y*(-11214424.18+y*(77392.33017+y*(-184.9052456)))));
21 ans2=57568490411.0+y*(1029532985.0+y*(9494680.718+y*(59272.64853+y*(267.8532712+y*1.0))));
27 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4+y*(-0.2073370639e-5+y*0.2093887211e-6)));
28 ans2 = -0.1562499995e-1+y*(0.1430488765e-3+y*(-0.6911147651e-5+y*(0.7621095161e-6-y*0.934945152e-7)));
29 ans=
sqrt(0.636619772/ax)*(
cos(xx)*ans1-z*
sin(xx)*ans2);
38 double xx,y,ans,ans1,ans2;
41 ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6+y*(10879881.29+y*(-86327.92757+y*228.4622733))));
42 ans2=40076544269.0+y*(745249964.8+y*(7189466.438+y*(47447.26470+y*(226.1030244+y*1.0))));
43 ans=(ans1/ans2)+0.636619772*
bessj0(x)*
log(x);
48 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4+y*(-0.2073370639e-5+y*0.2093887211e-6)));
49 ans2 = -0.1562499995e-1+y*(0.1430488765e-3+y*(-0.6911147651e-5+y*(0.7621095161e-6+y*(-0.934945152e-7))));
50 ans=
sqrt(0.636619772/x)*(
sin(xx)*ans1+z*
cos(xx)*ans2);
58 double xx,y,ans,ans1,ans2;
59 if ((ax=
fabs(x)) < 8.0) {
61 ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1+y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
62 ans2=144725228442.0+y*(2300535178.0+y*(18583304.74+y*(99447.43394+y*(376.9991397+y*1.0))));
68 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4+y*(0.2457520174e-5+y*(-0.240337019e-6))));
69 ans2=0.04687499995+y*(-0.2002690873e-3+y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6)));
70 ans=
sqrt(0.636619772/ax)*(
cos(xx)*ans1-z*
sin(xx)*ans2);
71 if ((x) < 0.0) ans = -ans;
80 double xx,y,ans,ans1,ans2;
83 ans1=x*(-0.4900604943e13+y*(0.1275274390e13+y*(-0.5153438139e11+y*(0.7349264551e9+y*(-0.4237922726e7+y*0.8511937935e4)))));
84 ans2=0.2499580570e14+y*(0.4244419664e12+y*(0.3733650367e10+y*(0.2245904002e8+y*(0.1020426050e6+y*(0.3549632885e3+y)))));
85 ans=(ans1/ans2)+0.636619772*(
bessj1(x)*
log(x)-1.0/
x);
90 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4+y*(0.2457520174e-5+y*(-0.240337019e-6))));
91 ans2=0.04687499995+y*(-0.2002690873e-3+y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6)));
92 ans=
sqrt(0.636619772/x)*(
sin(xx)*ans1+z*
cos(xx)*ans2);
102 double by,bym,byp,tox;
103 if (n < 2) cerr <<
"Index n less than 2 in bessy" <<
endl;
120 double ax,bj,bjm,bjp,
sum,tox,ans;
121 if (n < 2) cerr <<
"Index n less than 2 in bessj" <<
endl;
125 else if ((ax) > (
double) n) {
158 return (x) < 0.0 && (n & 1) ? -ans : ans;
165 if ((ax=
fabs(x)) < 3.75) {
168 ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492+y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
171 ans=(
exp(ax)/
sqrt(ax))*(0.39894228+y*(0.1328592e-1+y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2+y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1+y*0.392377e-2))))))));
182 ans=(-
log(x/2.0)*
bessi0(x))+(-0.57721566+y*(0.42278420+y*(0.23069756+y*(0.3488590e-1+y*(0.262698e-2+y*(0.10750e-3+y*0.74e-5))))));
185 ans=(
exp(-x)/
sqrt(x))*(1.25331414+y*(-0.7832358e-1+y*(0.2189568e-1+y*(-0.1062446e-1+y*(0.587872e-2+y*(-0.251540e-2+y*0.53208e-3))))));
194 if ((ax=
fabs(x)) < 3.75) {
197 ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934+y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
200 ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1-y*0.420059e-2));
201 ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2+y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
204 return (x) < 0.0 ? -ans : ans;
213 ans=(
log(x/2.0)*
bessi1(x))+(1.0/x)*(1.0+y*(0.15443144+y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1+y*(-0.110404e-2+y*(-0.4686e-4)))))));
216 ans=(
exp(-x)/
sqrt(x))*(1.25331414+y*(0.23498619+y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2+y*(0.325614e-2+y*(-0.68245e-3)))))));
226 double bk,bkm,bkp,tox;
227 if (n < 2) cerr<<
"Index n less than 2 in bessk"<<
endl;
243 double bi,bim,bip,tox,ans;
244 if (n < 2) cerr<<
"Index n less than 2 in bessi"<<
endl;
251 for (j=2*(n+(
int)
sqrt(
ACC*n));j>0;j--) {
263 return (x) < 0.0 && (n & 1) ? -ans : ans;
double besselY(double x, int nu)
double besselJ(double x, int nu)
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
df1_two_variable fabs(const df1_two_variable &x)
double bessk(int n, double x)
double besselI(double x, int nu)
prnstream & endl(prnstream &)
double besselK(double x, int nu)
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double bessy(int n, double x)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
double bessi(int n, double x)
double bessj(int n, double x)
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.