1 SUBROUTINE dkia(IFAC,X,A,DKI,DKID,IERRO)
2 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
3 cccc the purpouse
of the routine
is the calculation
of the
4 cccc modified bessel functions k_ia(
x) and
k'_IA(X),
5 CCCC WHERE I IS THE IMAGINARY UNIT AND X IS THE ARGUMENT OF THE
6 CCCC FUNCTIONS. WE WILL REFER TO A AS THE ORDER OF THE FUNCTIONS.
8 CCCC THE ROUTINE HAS THE OPTION OF COMPUTING SCALED FUNCTIONS.
9 CCCC THIS SCALING CAN BE USED TO ENLARGE THE RANGE OF
11 CCCC THE SCALED FUNCTIONS ARE DEFINED AS FOLLOWS
12 CCCC (S STANDS FOR SCALED AND
13 CCCC L=SQRT{X**2-A**2} + A*ARCSIN(A/X)):
15 CCCC EXP(L)*K_IA(X), IF X >=ABS(A)
17 CCCC EXP(ABS(A)*PI/2)*K_IA(X), IF X < ABS(A)
20 CCCC EXP(L)*K'_ia(
x),
IF x >=abs(a)
22 CCCC EXP(ABS(A)*PI/2)*K'_ia(
x),
IF x < abs(a)
25 cccc scaled functions
is:
26 cccc 0 <
x <= 1500, -1500 <= a <= 1500.
27 cccc
for functions without scaling, the
range is usually larger
29 cccc 0 <
x <= 500, -400 <= a <= 400,
33 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
34 cccc methods
of computation:
35 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
36 cccc 1) series,
IF abs(a) > 0.044*abs(
x-3.1)**1.9+(
x-3.1)
38 cccc
IF x>3 and abs(a) < 380*(abs((
x-3)/2300))**0.572
39 cccc 3) airy-
TYPE asymptotic expansion,
40 cccc
IF abs(a) > 0.4*
x+7.5 and abs(a) < 3.7*
x-10
43 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
45 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
47 cccc
x : argument
of the functions
48 ccc a : order
of the functions
49 cccc ifac :
INTEGER flag for the scaling
50 cccc *
IF ifac=1, the code computes kia(
x), kia
'(X)
51 CCCC * OTHERWISE, THE CODE COMPUTES SCALED KIA(X), KIA'(
x)
53 cccc dki : kia(
x) function
54 cccc dkid : derivative
of the kia(
x)
FUNCTION
56 cccc *
IF ierro=0, computation successful.
57 cccc *
IF ierro=1, computation out
of range.
58 cccc *
IF ierro=2, variables
x and/or a, out
of range.
59 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
61 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
62 cccc the relative accuracy
is:
63 cccc better than 10**(-13)
for(
x,a)
in(0,200]
x[-200,200];
64 cccc better than 5.10**(-13)
for(
x,a)
in(0,500]
x[-500,500];
65 cccc
CLOSE to 10**(-12)
for(
x,a)
in(0,1500]
x[-1500,1500].
66 cccc near the
zeros of the functions(there are infinitely
67 cccc many
of them
in the oscillatory region) relative
precision
68 cccc looses meaning and only absolute
precision makes sense.
69 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
71 c amparo gil(u. cantabria, santander, spain).
72 c e-mail: amparo.gil@unican.es
73 c javier segura(u. cantabria, santander, spain).
74 c e-mail: segurajj@unican.es
75 c nico m. temme(cwi, amsterdam, the netherlands).
76 c e-mail: nico.temme@cwi.nl
77 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
79 c this is the companion software
of the articles
80 c 1)
'COMPUTING SOLUTIONS OF THE MODIFIED BESSEL DIFFERENTIAL
81 C EQUATION FOR IMAGINARY ORDERS AND POSITIVE ARGUMENTS',
82 c a. gil, j. segura,
n.m. temme
83 c acm trans. math. soft. (2004)
84 c 2)
'MODIFIED BESSEL FUNCTIONS OF IMAGINARY ORDER AND
86 c a. gil, j. segura,
n.m. temme
87 c acm trans. math. soft. (2004)
88 c additional references:
89 c -
'COMPUTATION OF THE MODIFIED BESSEL FUNCTION OF THE
90 C THIRD KIND FOR IMAGINARY ORDERS'
91 c a. gil, j. segura,
n.m. temme
92 c j. comput. phys. 175 (2002) 398-411
93 c -
'COMPUTATION OF THE MODIFIED BESSEL FUNCTIONS OF THE
94 C THIRD KIND OF IMAGINARY ORDERS:
95 C UNIFORM AIRY-TYPE ASYMPTOTIC EXPANSION'
96 c a. gil, j. segura,
n.m. temme, proceedings opsfa 2001
97 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
99 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
101 c df1: 0.044*abs(
d)**1.9+(
x-3.1)
102 c df2: 380*(abs((
x-3)/2300))**0.572
105 c pnu: order
of the
FUNCTION
106 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
107 DOUBLE PRECISION a,
d,df1,df2,df3,df4,dki,
112 IF ((
x.GT.1500.d0).OR.(
x.LE.0.d0))
THEN
117 IF (abs(pnu).GT.1500.d0)
THEN
123 cccccccccccccccccccccccccccccccccccccccccccccccc
124 ccc these functions are even functions
in the
c
125 ccc
PARAMETER a(=pnu)
c
126 cccccccccccccccccccccccccccccccccccccccccccccccc
127 IF (pnu.LT.0.d0) pnu=-pnu
129 df1=0.044d0*abs(
d)**1.9d0+
d
130 df2=380.d0*(abs((
x-3.d0)/2300.d0))**0.572d0
134 CALL serkia(ifac,
x,pnu,dki,dkid,ierro)
135 ELSEIF ((
x.GT.3.d0).AND.(pnu.LT.df2))
THEN
136 CALL frakia(ifac,
x,pnu,dki,dkid,ierro)
137 ELSEIF ((pnu.GT.df3).AND.(pnu.LT.df4))
THEN
138 CALL aiexki(ifac,
x,pnu,dki,dkid,ierro)
140 CALL dkint(ifac,
x,pnu,dki,dkid,ierro)
146 SUBROUTINE dkint(IFAC,XX,PNUA,DKINF,DKIND,IERRO)
147 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
148 ccc calculation
of the functions
k,
k' USING NON-OSCILLATING C
149 CCC INTEGRAL REPRESENTATIONS C
152 CCC XX: ARGUMENT OF THE FUNCTIONS C
153 CCC PNUA: ORDER OF THE FUNCTIONS C
155 CCC =1, NON SCALED FUNCTIONS C
156 CCC OTYHERWISE, SCALED FUNCTIONS C
158 CCC DKINF: K FUNCTION C
159 CCC DKIND: DERIVATIVE OF THE K FUNCTION C
160 CCC IERRO: ERROR FLAG C
161 CCC * IF IERRO=0, COMPUTATION SUCCESSFUL. C
162 CCC * IF IERRO=1, COMPUTATION OUT OF RANGE. C
163 CCC * IF IERRO=2, ARGUMENT AND/OR ORDER, OUT OF RANGE. C
164 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
165 CCC METHOD OF COMPUTATION:
166 CCC * IF XX>=PNUA, THE NON-OSCILLATING INTEGRAL REPRESENTATIONS
167 CCC FOR THE MONOTONIC REGION ARE USED
168 CCC * IF XX<PNUA, THE NON-OSCILLATING INTEGRAL REPRESENTATIONS
169 CCC FOR THE OSCILLATORY REGION ARE USED
170 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
172 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
173 C CHI : X*SINH(MU)-PNU*MU
174 C CONTR1 : CONTRIBUTION OF THE SEMI-INFINITE INTEGRAL
175 C IN THE OSCILLATORY CASE (INCLUDING ADDITIONAL
176 C FACTORS: CONTR1=FOS1*FACTORS).
178 C COSH2M : COSH(2*MU)
180 C COSTH : COS(THET), THET=ASIN(PNU/X)
181 C DF1 : FACTOR (DEPENDING ON IFAC)
183 C DMU : SOLUTION MU OF COSH(MU)=PNU/X
189 C DMUFAC : MU*COSH(MU)-SINH(MU)
190 C DMUTAN : MU-TANH(MU)
191 C FDOMIN : X*(COS(THET)+THET*SIN(THET))
192 C FOS1 : CONTRIBUTION OF THE SEMI-INFINITE INTEGRAL
193 C IN THE OSCILLATORY CASE (KIA(X)).
194 C FOSD1 : CONTRIBUTION OF THE SEMI-INFINITE INTEGRAL
195 C IN THE OSCILLATORY CASE (KIA'(
x)).
196 c hir : monotonic
CASE, contribution
of the
integral
198 c hird : monotonic
CASE, contribution
of the
integral
202 C PNU : ORDER OF THE FUNCTION
204 C SINH2M : SINH(2*MU)
208 C UNDER : UNDERFLOW NUMBER
209 C X : ARGUMENT OF THE FUNCTION
210 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
211 DOUBLE PRECISION CHI,CONTR1,COSCHI,COSH2M,COSHM,COSTH,
212 + D1MACH,DF1,DKIND,DKINF,DMAIN,DMU,DMU2,DMU3,DMU5,DMU7,
213 + DMU9,DMUFAC,DMUTAN,FDOMIN,FOS1,FOSD1,HIR,HIRD,PI,
214 + PINU,PNU,PNUA,SINCHI,SINH2M,SINHM,SINTH,THET,UNDER,
218 COMMON/PARMON/THET,SINTH,COSTH,FDOMIN
219 COMMON/PAROS1/DMU,COSHM,SINHM,DMUFAC,COSCHI,SINCHI
220 COMMON/PAROS2/COSH2M,SINH2M,DMAIN
222 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
223 UNDER=D1MACH(1)*1.D+8
228 CCCCCCCCCCCCCCCCCCCCCCCCCC
229 CCC MONOTONIC REGION CC
230 CCCCCCCCCCCCCCCCCCCCCCCCCC
234 FDOMIN=X*(COSTH+THET*SINTH)
236 .LE.
IF (-FDOMINLOG(UNDER)) IERRO=1
238 .EQ.
IF (IERRO0) THEN
239 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
240 CCC CALCULATION OF KIA:
241 CCC CALL TO THE TRAPEZOIDAL ROUTINE C
242 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
245 DKINF=0.5D0*HIR*EXP(-FDOMIN)
249 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
250 CCC CALCULATION OF KIA':
251 ccc CALL
to the trapezoidal routine
c
252 ccccccccccccccccccccccccccccccccccccccccc
255 dkind=-hird*exp(-fdomin)
264 cccccccccccccccccccccccccccc
265 ccc oscillatory region cc
266 cccccccccccccccccccccccccccc
269 IF ((-
pi*pnu*0.5d0).LE.
log(under)) ierro=1
273 dmu=
log(coshm+sqrt((coshm-1.d0)*(coshm+1.d0)))
278 IF (dmu.GT.0.1d0)
THEN
280 dmufac=dmu*coshm-sinhm
287 chi=-2.d0*
x*(1.d0/6.d0*dmu3+1.d0/60.d0*dmu5+
288 + 3.d0/5040.d0*dmu7+4.d0/362880.d0*dmu9)
289 dmufac=dmu3/3.d0+dmu5/30.d0+dmu7/840.d0+dmu9/45360.d0
300 ccccccccccccccccccccccccccccccccccccccccccccc
301 ccc
THEN, the kia
FUNCTION is given by ... cc
302 ccccccccccccccccccccccccccccccccccccccccccccc
311 cccccccccccccccccccccccccc
312 ccc calculation
of kia
' CC
313 CCCCCCCCCCCCCCCCCCCCCCCCCC
317 CALL TRAPRE(20,FOSD1)
318 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
319 CCC THEN, KIA' is given by ...
320 cccccccccccccccccccccccccccccccccc
337 DOUBLE PRECISION FUNCTION fa(U)
338 cccccccccccccccccccccccccccccccccccccccccccccccc
341 ccc
in the monotonic region.
342 cccccccccccccccccccccccccccccccccccccccccccccccc
344 cccccccccccccccccccccccccccccccccccccccccccccccc
345 c u : argument
of the
FUNCTION
346 c(variable
of integration).
347 cccccccccccccccccccccccccccccccccccccccccccccccc
349 cccccccccccccccccccccccccccccccccccccccccccccccc
350 c phir :
x*cosh(u)*
cos(
v(u))+pnu*
v(u)
352 c v(u)=asin(u/sinh(u)*sin(thet))
353 c and fdomin=
x*(
cos(thet)+
356 cccccccccccccccccccccccccccccccccccccccccccccccc
357 DOUBLE PRECISION d1mach,phir,u,under
358 ccc machine dependent constant(
underflow number)
360 IF ((-phir(u)).LE.
log(under))
THEN
368 DOUBLE PRECISION FUNCTION fad(T)
369 cccccccccccccccccccccccccccccccccccccccccccccccccc
372 ccc the
k FUNCTION in the monotonic region.
373 cccccccccccccccccccccccccccccccccccccccccccccccccc
375 cccccccccccccccccccccccccccccccccccccccccccccccccc
376 c t : argument
of the
FUNCTION
377 c(variable
of integration).
378 cccccccccccccccccccccccccccccccccccccccccccccccccc
380 cccccccccccccccccccccccccccccccccccccccccccccccccc
385 c dfac :
cos(thet)+(fu1+2.d0*sin(ang/2)
386 c *sin(ang/2))/
cos(vu)
387 c djaco : cosh(
t)*exp(
s)/(1.d0+exp(
s))
388 c expo : exp(-phir(u))
389 c fdomin :
x*(
cos(thet)+thet*sin(thet))
390 c fu1 : 2*sinh(u/2)**2
391 c fuac : u**3/6+u**5/120+u**7/5040
392 c phir(u) :
x*cosh(u)*
cos(
v(u))+pnu*
v(u)-fdomin
394 c sinanh : sin(ang/2)
406 c v(u) : asin(u/sinh(u)*sin(thet))
409 cccccccccccccccccccccccccccccccccccccccccccccccccccc
410 DOUBLE PRECISION ang,angh,costh,cosvu,
d1mach,
411 + dfac,djaco,expo,fdomin,fu1,fuac,phir,
s,sinanh,
412 + sinhu,sinhuh,sinth,
t,thet,u,u2,u3,u5,u7,uh,under,
414 common/parmon/thet,sinth,costh,fdomin
415 ccc machine dependent constant(
underflow number)
420 djaco=cosh(
t)*
y/(1.d0+
y)
421 IF (abs(u).LT.1.
d-1)
THEN
422 IF (abs(u).LT.under)
THEN
427 fu1=2.d0*sinhuh*sinhuh
432 fuac=u3/6.d0+u5/120.d0+u7/5040.d0
436 ang=asin(-sinth/(costh*u/sinhu+cosvu)*
437 + (sinhu+u)*fuac/(sinhu*sinhu))
440 dfac=costh+(fu1+2.d0*sinanh*sinanh)/cosvu
448 dfac=costh+(fu1+2.d0*sinanh*sinanh)/
cos(vu)
450 IF ((-phir(u)).LE.
log(under))
THEN
459 DOUBLE PRECISION FUNCTION fdtau2(T)
460 cccccccccccccccccccccccccccccccccccccccccccccccccccc
463 ccc
in eq.(37)
of the reference:
464 ccc
'COMPUTING SOLUTIONS OF THE MODIFIED BESSEL
465 CCC DIFFERENTIAL EQUATION FOR IMAGINARY ORDERS
466 CCC AND POSITIVE ARGUMENTS',
467 ccc a. gil, j. segura,
n.m. temme
468 ccc acm trans. math. soft. (2004)
469 cccccccccccccccccccccccccccccccccccccccccccccccccccc
471 cccccccccccccccccccccccccccccccccccccccccccccccccccc
472 c t : argument
of the
FUNCTION
473 c(variable
of integration).
474 cccccccccccccccccccccccccccccccccccccccccccccccccccc
476 cccccccccccccccccccccccccccccccccccccccccccccccccccc
477 c argu : (cosh(mu)*u-dmufac)/sinh(u)
479 c coschi : cosh(chi), chi=
x*sinh(mu)-pnu*mu
480 c cosh2m : cosh(2*mu)
483 c coss :
cos(sigma(u))
484 c d1 : cosh(mu)-dmufac
485 c delta : -sin(chi)*
cos(sigma(u))*cosh(u)
486 c +
cos(chi)*sin(sigma(u))*sinh(u)
487 c deri : (cosh(mu)/sinh(u)-d1*cosh(u)/sinh(u)**2)
489 c djaco : cosh(
t)*exp(
s)/sqrt(1+exp(
s)**2)
491 c dmu : solution mu
of cosh(mu)=pnu/
x
493 c dmufac : mu*cosh(mu)-sinh(mu)
494 c expon : exp(-(phib(u)-
pi*pnu*0.5))
495 c f1 : sinh(u-mu)/(u-mu)
496 c g1 :
z/6+z3/120+z5/5040+z7/362880,
z=2*
y
497 c gamma : sin(chi)*sin(sigma(u))*sinh(u)+
498 c cos(chi)*
cos(sigma(u))*cosh(u)
499 c phib(u) :
x*cosh(u)*
cos(sigma(u))+pnu*sigma(u),
500 c WHERE x=argument
of the function,
501 c sigma(u)=arcsin((cosh(mu)*u-dmufac)/sinh(u)
502 c resto : -sin(chi)*
cos(sigma(u))*cosh(u)
503 c +
cos(chi)*sin(sigma(u))*sinh(u)+
504 c(sin(chi)*sin(sigma(u))*sinh(u)+
505 c cos(chi)*
cos(sigma(u))*cosh(u))*deri
507 c sigma(u): asin((cosh(mu)*u-dmufac)/sinh(u))
510 c sinh2m : sinh(2*mu)
514 c sins : sin(sigma(u))
515 c u : mu+
log(
x+sqrt(
x**2+1))
524 cccccccccccccccccccccccccccccccccccccccccccccccccccc
525 DOUBLE PRECISION argu,argu2,coschi,cosh2m,coshm,
526 + coshu,coss,d1,
d1mach,delta,deri,djaco,dmain,dmu,
527 + dmu2,dmufac,dmutan,expon,f1,g1,
gamma,phib,resto,
528 +
s,sigma,sigmau,sinchi,sinh2m,sinhm,sinhu,sinhu2,
529 + sins,
t,u,under,
x,
y,
z,
z2,z3,z5,z7
530 common/paros1/dmu,coshm,sinhm,dmufac,coschi,sinchi
531 common/paros2/cosh2m,sinh2m,dmain
533 ccc machine dependent constant(
underflow number)
537 u=dmutan+
log(
x+sqrt(
x*
x+1.d0))
541 IF (abs(
y).LE.1.
d-1)
THEN
542 IF (abs(
y).GT.under)
THEN
552 g1=
z/6.d0+z3/120.d0+z5/5040.d0+z7/362880.d0
554 deri=sinhu/(f1-coshm*coshu)*sqrt(cosh(dmu2)*f1*f1+
555 + 2.d0*sinh(dmu2)*g1-coshm*coshm)
562 deri=1.d0/sqrt(1.d0-argu2)*(coshm/sinhu-
564 IF (u.LT.dmu) deri=-deri
566 djaco=cosh(
t)*
x/sqrt(1.d0+
x*
x)
567 IF ((-(phib(u)-dmain)).LE.
log(under))
THEN
571 expon=exp(-(phib(u)-dmain))
575 gamma=coschi*sins*sinhu-sinchi*coss*coshu
576 delta=-coschi*coss*coshu-sinchi*sins*sinhu
577 resto=delta+
gamma*deri
578 fdtau2=expon*resto*djaco
583 DOUBLE PRECISION FUNCTION fstau2(T)
584 ccccccccccccccccccccccccccccccccccccccccccccccccc
588 ccc
'COMPUTING SOLUTIONS OF THE MODIFIED BESSEL
589 CCC DIFFERENTIAL EQUATION FOR IMAGINARY ORDERS
590 CCC AND POSITIVE ARGUMENTS',
591 ccc a. gil, j. segura,
n.m. temme
592 ccc acm trans. math. soft. (2004)
593 cccccccccccccccccccccccccccccccccccccccccccccccccccc
595 cccccccccccccccccccccccccccccccccccccccccccccccccccc
596 c t : argument
of the
FUNCTION
597 c(variable
of integration).
598 ccccccccccccccccccccccccccccccccccccccccccccccccc
600 ccccccccccccccccccccccccccccccccccccccccccccccccc
601 c argu : (cosh(mu)*u-dmufac)/sinh(u)
603 c coschi : cosh(chi), chi=
x*sinh(mu)-pnu*mu
604 c cosh2m : cosh(2*mu)
606 c d1 : cosh(mu)-dmufac
607 c deri : (cosh(mu)/sinh(u)-d1*cosh(u)/sinh(u)**2)
609 c djaco : cosh(
t)*exp(
s)/sqrt(1+exp(
s)**2)
611 c dmu : solution mu
of cosh(mu)=pnu/
x
613 c dmufac : mu*cosh(mu)-sinh(mu)
614 c expon : exp(-(phib(u)-
pi*pnu*0.5))
615 c f1 : sinh(u-mu)/(u-mu)
616 c g1 :
z/6+z3/120+z5/5040+z7/362880,
z=2*
y
617 c phib(u) :
x*cosh(u)*
cos(sigma(u))+pnu*sigma(u),
618 c WHERE x=argument
of the function,
619 c sigma(u)=arcsin((cosh(mu)*u-dmufac)/sinh(u)
620 c resto :
cos(chi)+sin(chi)*deri
623 c sinh2m : sinh(2*mu)
627 c u : mu+
log(
x+sqrt(
x**2+1))
636 ccccccccccccccccccccccccccccccccccccccccccccccccc
637 DOUBLE PRECISION argu,argu2,coschi,cosh2m,
638 + coshm,d1,
d1mach,deri,djaco,dmain,dmu,dmu2,
639 + dmufac,dmutan,expon,f1,g1,phib,resto,
s,sinchi,
640 + sinh2m,sinhm,sinhu,sinhu2,
t,u,under,
x,
y,
z,
z2,
642 common/paros1/dmu,coshm,sinhm,dmufac,coschi,sinchi
643 common/paros2/cosh2m,sinh2m,dmain
645 ccc machine dependent constant(
underflow number)
649 u=dmutan+
log(
x+sqrt(
x*
x+1.d0))
651 IF (abs(
y).GT.under)
THEN
658 IF (abs(
y).LE.0.1d0)
THEN
662 g1=
z/6.d0+z3/120.d0+z5/5040.d0+z7/362880.d0
664 deri=sinh(u)/(f1-coshm*cosh(u))*
665 + sqrt(cosh(dmu2)*f1*f1+2.d0*sinh(dmu2)*g1-
674 deri=1.d0/sqrt(1.d0-argu2)*
675 + (coshm/sinhu-d1*cosh(u)/sinhu2)
676 IF (u.LT.dmu) deri=-deri
678 djaco=cosh(
t)*
x/sqrt(1.d0+
x*
x)
679 IF ((-(phib(u)-dmain)).LE.
log(under))
THEN
683 expon=exp(-(phib(u)-dmain))
684 resto=(coschi+sinchi*deri)
685 fstau2=expon*resto*djaco
690 SUBROUTINE trapre(IC,TI)
691 cccccccccccccccccccccccccccccccccccccccccccccccccc
692 ccc implementation
of an adaptive trapezoidal rule
694 ccc the functions,
for the different regions
695 ccc(monotonic or oscillatory).
698 ccc ic: depending on the values
of ic,
699 ccc different integrals are computed:
700 ccc *ic=1,
k function, monotonic region
701 ccc *ic=2,
k function, oscillatory region
702 ccc *ic=10, derivative
of the
k function,
703 ccc monotonic region.
704 ccc *ic=20, derivative
of the
k function,
705 ccc oscillatory region.
708 cccccccccccccccccccccccccccccccccccccccccccccccccccc
710 cccccccccccccccccccccccccccccccccccccccccccccccccccc
711 c a : lower integration limit
712 c b : upper integration limit
716 c h : integration step
717 c pnu : order
of the function
718 c sum : accumulates the elementary
722 c xac : integration abcissa
724 cccccccccccccccccccccccccccccccccccccccccccccccccccc
725 DOUBLE PRECISION a,b,
d1mach,delta,
eps,finte,h,
726 + pnu,sum,ti,tin,
x,xac,
z
732 ccccc integration limits: a,b
734 IF ((
z.GT.0.999d0).AND.(
z.LT.1.001d0))
THEN
735 IF ((ic.EQ.1).OR.(ic.EQ.10))
THEN
741 IF ((ic.EQ.2).OR.(ic.EQ.20))
THEN
749 ti=0.5d0*h*(finte(ic,a)+finte(ic,b))
761 sum=sum+finte(ic,xac)
764 IF ((tin.NE.0.d0).AND.(
n.GT.4))
THEN
765 delta=abs(1.d0-ti/tin)
768 IF ((delta.GT.
eps).AND.(
n.LT.9)) goto 11
772 DOUBLE PRECISION FUNCTION finte(IC,T)
773 ccccccccccccccccccccccccccccccccccccccccccccccccccc
774 ccc auxiliary
FUNCTION for the subroutine trapre.
775 ccc
this FUNCTION calls the different functions
776 ccc containing the integrands which are integrated
778 ccccccccccccccccccccccccccccccccccccccccccccccccccc
781 ccc values are the same
as in the
c
782 ccc
SUBROUTINE trapre.
c
783 ccc
t: integration abscissa
c
784 ccccccccccccccccccccccccccccccccccccccccccccccccccc
786 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc
787 c fa : monotonic
part contribution
789 c fad : monotonic
part contribution
791 C FDTAU2 : OSCILLATORY PART: TAU CONTRIBUTION ROUTINE
792 C (KIA'(
x) function). semi-infinite
integral.
794 c fstau2 : oscillatory
part: tau contribution routine
797 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc
798 DOUBLE PRECISION fa,fad,fdtau2,fstau2,
t
814 SUBROUTINE frakia(IFAC,X,PNU,PSER,PSERD,IERRO)
815 cccccccccccccccccccccccccccccccccccccccccccccccccccc
817 ccc method
for the calculation
of k and
k' C
818 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
819 CCC INPUT VARIABLES: C
820 CCC X: ARGUMENT OF THE FUNCTIONS C
821 CCC PNU: ORDER OF THE FUNCTIONS C
823 CCC =1, NON SCALED FUNCTIONS C
824 CCC OTHERWISE, SCALED FUNCTIONS C
825 CCC OUTPUT VARIABLES: C
826 CCC PSER: K FUNCTION C
827 CCC PSERD: DERIVATIVE OF THE K FUNCTION C
828 CCC IERRO: ERROR FLAG C
829 CCC * IF IERRO=0, COMPUTATION SUCCESSFUL. C
830 CCC * IF IERRO=1, COMPUTATION OUT OF RANGE. C
831 CCC * IF IERRO=2, ARGUMENT AND/OR ORDER, C
833 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
834 CCC LOCAL VARIABLES: C
835 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
836 C A : (PNU), ORDER OF THE FUNCTIONS
838 C AA : AUXILIARY VARIABLE IN THE IMPLEMENTATION
839 C OF THE LENZ-THOMPSON ALGORITHM
840 C AB : AUXILIARY VARIABLE IN THE IMPLEMENTATION
841 C OF THE LENZ-THOMPSON ALGORITHM
842 C B : AUXILIARY VARIABLE IN THE IMPLEMENTATION
843 C OF THE LENZ-THOMPSON ALGORITHM
844 C CC : AUXILIARY VARIABLE IN THE IMPLEMENTATION
845 C OF THE LENZ-THOMPSON ALGORITHM
847 C D : AUXILIARY VARIABLE IN THE IMPLEMENTATION
848 C OF THE LENZ-THOMPSON ALGORITHM
849 C DELS : AUXILIARY VARIABLE IN THE IMPLEMENTATION
850 C OF THE LENZ-THOMPSON ALGORITHM
851 C DELTA : AUXILIARY VARIABLE IN THE IMPLEMENTATION
852 C OF THE LENZ-THOMPSON ALGORITHM
853 C FC : CONTINUED FRACTION FOR K(PNU+1)/K(PNU)
854 C FDOMIN : X*(COS(THET)+THET*SIN(THET))
861 c q0b : auxiliary variable
in the implementation
863 c q1b : auxiliary variable
in the implementation
865 c qb : auxiliary variable
in the implementation
867 c qqb : auxiliary variable
in the implementation
869 c s : auxiliary variable
in the implementation
875 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
876 DOUBLE PRECISION a,
a2,aa,ab,b,cc,costh,
d,
d1mach,
877 + dels,delta,fc,fdomin,
k,kp,
pi,pia,pisq,pnu,preci,
878 + pser,pserd,q0b,q1b,qb,qqb,
s,sinth,thet,under,
x,z0
879 INTEGER ierro,ifac,mm
880 ccc machine dependent constant(
underflow number)
889 fdomin=
x*(costh+thet*sinth)
890 IF (-fdomin.LE.
log(under)) ierro=1
892 IF ((-
pi*pnu*0.5d0).LE.
log(under)) ierro=1
900 ccc cf
for k(nu+1)/
k(nu)
916 delta=(b*
d-1.d0)*delta
919 qb=(q0b-(b-2.d0)*q1b)/ab
928 IF (mm.LT.10000)
THEN
929 IF (abs(dels/
s).GT.preci) goto 91
933 k=pisq*(2.d0*
x)**(-0.5d0)*exp(-
x)*z0
934 kp=-
k/
x*(0.5d0+
x-(
a2+0.25d0)*fc)
938 k=pisq*(2.d0*
x)**(-0.5d0)*exp(-
x+pia*0.5d0)*z0
939 kp=-
k/
x*(0.5d0+
x-(
a2+0.25d0)*fc)
944 fdomin=
x*(costh+thet*sinth)
945 k=pisq*(2.d0*
x)**(-0.5d0)*exp(-
x+fdomin)*z0
946 kp=-
k/
x*(0.5d0+
x-(
a2+0.25d0)*fc)
958 SUBROUTINE serkia(IFAC,X,PNU,PSER,PSERD,IERRO)
959 ccccccccccccccccccccccccccccccccccccccccccccccccccccc
960 ccc calculation
of power series
for k,
k'
961 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
962 CCC INPUT VARIABLES: C
963 CCC X: ARGUMENT OF THE FUNCTIONS C
964 CCC PNU: ORDER OF THE FUNCTIONS C
966 CCC =1, NON SCALED FUNCTIONS C
967 CCC OTHERWISE, SCALED FUNCTIONS C
968 CCC OUTPUT VARIABLES: C
969 CCC PSER: K FUNCTION C
970 CCC PSERD: DERIVATIVE OF THE K FUNCTION C
971 CCC IERRO: ERROR FLAG C
972 CCC * IF IERRO=0, COMPUTATION SUCCESSFUL. C
973 CCC * IF IERRO=1, COMPUTATION OUT OF RANGE. C
974 CCC * IF IERRO=2, ARGUMENT AND/OR ORDER, C
976 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
977 CCC LOCAL VARIABLES: C
978 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
979 C A : (PNU) ORDER OF THE FUNCTIONS
983 C ACCP : ACCUMULATES THE P COEFFICIENTS
984 C ACCQ : ACCUMULATES THE Q COEFFICIENTS
985 C ARGU : SIG(0)-A*LOG(X/2)
987 C COCI : 1/(K**2+A**2)
989 C DELTAK : ACCUMULATES THE CONTRIBUTION FOR THE
991 C DELTKP : ACCUMULATES THE CONTRIBUTION FOR THE
993 c df1 :
factor(depending on ifac)
994 c eta0 :
PARAMETER for the calculation
of the
998 c /(a**2*(1+a**2)...(
k**2+a**2))**1/2,
1000 c fdomin :
x*(
cos(thet)+thet*sin(thet))
1001 c k : contribution
to the kia(
x) function
1002 c kp : contribution
to the kia
'(X) FUNCTION
1003 C OVER : OVERFLOW NUMBER
1004 C P0 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1006 C P1 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1008 C P2 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1013 C PRECI : RELATIVE PRECISION USED IN THE CALCULATION
1014 C Q0 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1016 C Q1 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1018 C Q2 : PARAMETERS FOR THE CALCULATION OF THE COULOMB
1020 C R(K) : F(K)*A/TAN(PHI(A,K)-A*LOG(X/2))
1021 C SIG0 : COULOMB PHASE SHIFT
1024 C UNDER : UNDERFLOW NUMBER
1026 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1027 DOUBLE PRECISION A,A2,A2N,ACCP,ACCQ,ARGU,C,COCI,COSTH,
1028 + D1MACH,DDS,DEE,DELTAK,DELTKP,DF1,DSMALL,ETA0,ETA02,
1029 + EULER,F(0:500),FDOMIN,K,KP,OVER,P0(0:9),P1(0:9),P2(0:6),
1030 + PI,PIA,PIA2,PNU,PRECI,PSER,PSERD,Q0(0:9),Q1(0:9),Q2(0:6),
1031 + R(0:500),SIG0,SINTH,THET,UNDER,X,X2
1032 INTEGER IERRO,IFAC,L,M,N
1033 SAVE P0,Q0,P1,Q1,P2,Q2
1034 DATA P0/1.08871504904797411683D5,3.64707573081160914640D5,
1035 + 4.88801471582878013158D5,3.36275736298197324009D5,
1036 + 1.26899226277838479804D5,
1037 + 2.60795543527084582682D4,2.73352480554497990544D3,
1038 + 1.26447543569902963184D2,
1039 + 1.85446022125533909390D0,1.90716219990037648146D-3/
1040 DATA Q0/6.14884786346071135090D5,2.29801588515708014282D6,
1041 + 3.50310844128424021934D6,
1042 + 2.81194990286041080264D6,1.28236441994358406742D6,
1043 + 3.35209348711803753154D5,
1044 + 4.84319580247948701171D4,3.54877039006873206531D3,
1045 + 1.11207201299804390166D2,1.D0/
1046 DATA P1/-1.044100987526487618670D10,-1.508574107180079913696D10,
1047 + -5.582652833355901160542D9,4.052529174369477275446D8,
1048 + 5.461712273118594275192D8,
1049 + 9.510404403068169395714D7,6.281126609997342119416D6,
1050 + 1.651178048950518520416D5,
1051 + 1.498824421329341285521D3,2.974686506595477984776D0/
1052 DATA Q1/1.808868161493543887787D10,3.869142051704700267785D10,
1053 + 3.003264575147162634046D10,1.075554651494601843525D10,
1054 + 1.901298501823290694245D9,
1055 + 1.665999832151229472632D8,6.952188089169487375936D6,
1056 + 1.253235080625688652718D5,7.904420414560291396996D2,1.D0/
1057 DATA P2/7.08638611024520906826D-3,-6.54026368947801591128D-2,
1058 + 2.92684143106158043933D-1,4.66821392319665609167D0,
1059 + -3.43943790382690949054D0,
1060 + -7.72786486869252994370D0,-9.88841771200290647461D-01/
1061 DATA Q2/-7.08638611024520908189D-3,6.59931690706339630254D-2,
1062 + -2.98754421632058618922D-1,-4.63752355513412248006D0,
1063 + 3.79700454098863541593D0,7.06184065426336718524D0,1.D0/
1065 ETA0=1.8055470716051069198764D0
1066 EULER=0.577215664901532860606512D0
1068 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
1069 OVER=D1MACH(2)*1.D-8
1070 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
1071 UNDER=D1MACH(1)*1.D+8
1073 .EQ.
IF (IFAC1) THEN
1078 FDOMIN=X*(COSTH+THET*SINTH)
1079 .LE.
IF (-FDOMINLOG(UNDER)) IERRO=1
1081 .LE.
IF ((-PI*PNU*0.5D0)LOG(UNDER)) IERRO=1
1084 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1085 CCC COEFFICIENTS FOR THE CALCULATION OF THE COULOMB PHASE SHIFT
1086 CCC FROM CODY & HILLSTROM, MATH. COMPUT. 24(111) 1970
1087 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1088 .EQ.
IF (IERRO0) THEN
1095 .LE.
IF (A2.D0) THEN
1100 .LE.
IF (N9) GOTO 33
1101 SIG0=A*(A2-ETA02)*ACCP/ACCQ
1103 .GT..AND..LE.
IF ((A2.D0)(A4.D0)) THEN
1108 .LE.
IF (N9) GOTO 44
1115 .LE.
IF (N6) GOTO 55
1116 SIG0=ATAN(A)*0.5D0+A*(LOG(1.D0+A2)*0.5D0+ACCP/ACCQ)
1119 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1120 CCC EVALUATION OF F(0), R(0), R(1)
1121 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1123 ARGU=SIG0-A*LOG(X*0.5D0)
1125 R(1)=1.D0/(1.D0+A2)*(R(0)-A*SIN(ARGU))
1126 .LT.
IF (AUNDER) THEN
1127 F(0)=-(EULER+LOG(X*0.5D0))
1129 F(0)=1.D0/A*SIN(ARGU)
1134 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1135 CCC RECURSION FOR F(K), R(K), C(K)
1136 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1142 66 F(M)=(M*F(M-1)+R(M-1))*COCI
1146 DELTKP=(M*F(M)-0.5D0*R(M))*C
1150 R(M)=((2.D0*M-1.D0)*R(M-1)-R(M-2))*COCI
1151 .GT.
IF (KOVER) M=500
1152 .GT.
IF (KPOVER) M=500
1154 .GT..OR.
IF ((ABS(DELTAK/K)PRECI)
1155 .GT.
+ (ABS(DELTKP/KP)PRECI)) GOTO 66
1158 .EQ.
IF (IFAC1) THEN
1159 .LE.
IF (-PIA2LOG(UNDER)) THEN
1164 .LT.
IF (A1.D-1) THEN
1165 .LT.
IF (AUNDER) THEN
1172 DDS=-DDS*PIA2/(L+1.D0)
1174 .GT.
IF (ABS(DDS/DSMALL)PRECI) GOTO 47
1175 DF1=EXP(PIA*0.5D0)*SQRT(DSMALL)
1178 DF1=EXP(PIA*0.5D0)*SQRT((1.D0-DEE)/PIA2)
1184 .LE.
IF (-PIA2LOG(UNDER)) THEN
1189 .LT.
IF (A1.D-1) THEN
1190 .LT.
IF (AUNDER) THEN
1197 DDS=-DDS*PIA2/(L+1.D0)
1199 .GT.
IF (ABS(DDS/DSMALL)PRECI) GOTO 48
1203 DF1=SQRT((1.D0-DEE)/PIA2)
1209 FDOMIN=X*(COSTH+THET*SINTH)
1210 .LE.
IF (-PIA2LOG(UNDER)) THEN
1215 .LT.
IF (A1.D-1) THEN
1216 .LT.
IF (AUNDER) THEN
1223 DDS=-DDS*PIA2/(L+1.D0)
1225 .GT.
IF (ABS(DDS/DSMALL)PRECI) GOTO 49
1226 DF1=EXP(PIA*0.5D0-FDOMIN)*SQRT(DSMALL)
1229 DF1=EXP(PIA*0.5D0-FDOMIN)*SQRT((1.D0-DEE)/PIA2)
1242 SUBROUTINE AIEXKI(IFAC,X,A,DKAI,DKAID,IERROK)
1243 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1244 CCC AIRY-TYPE ASYMPTOTIC EXPANSION FOR THE K AND K' c
1247 ccc input variables:
c
1248 ccc
x: argument
of the functions
c
1249 ccc a: order
of the functions
c
1251 ccc =1, non scaled functions
c
1252 ccc otherwise, scaled functions
c
1254 ccc dkai:
k FUNCTION c
1255 ccc dkaid: derivative
of the
k FUNCTION c
1257 ccc *
IF ierrok=0, computation successful.
c
1258 ccc *
IF ierrok=1, computation out
of range.
c
1259 ccc *
IF ierrok=2, argument and/or order,
c
1261 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1262 ccc local variables:
c
1263 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1264 c a0ex : exact
value of the coefficient a_0
1269 c ac : coefficients a_s(psi) used
in the expansions
1270 c aii : imaginary
part of the airy
FUNCTION ai(Z)
1271 c air :
REAL part of the airy function ai(
z)
1273 c arg : -a**(2/3)*psi
1274 c as : accumulates the contribution
of the ac coefficients
1275 c(
for the kia(
x) function)
1276 c asp : accumulates the contribution
of the ac coefficients
1277 c(
for the kia
'(X) FUNCTION)
1278 C B0EX : EXACT VALUE OF THE COEFFICIENT B_0
1279 C B0PEX : EXACT VALUE OF THE COEFFICIENT B'_0
1280 c bc : coefficients b_s(psi) used
in the expansions
1281 c bs : accumulates the contribution
of the bc coefficients
1282 c(
for the kia(
x) function)
1283 c bso : accumulates the old values
of bs
1284 c bsp : accumulates the contribution
of the bc coefficients
1285 c(
for the kia
'(X) FUNCTION)
1286 C BSPO : ACCUMULATES THE OLD VALUES OF BSP
1287 C C0EX : EXACT VALUE OF THE COEFFICIENT C_0
1288 C CHI : ACCUMULATES THE CONTRIBUTION OF THE CHIN COEFFICIENTS
1289 C CHIEX : EXACT VALUE OF THE FUNCTION CHI(PSI)
1290 C CHIN : COEFFICIENTS FOR THE EXPANSION OF THE FUNCTION
1293 C D0EX : EXACT VALUE OF THE COEFFICIENT D_0
1294 C DAII : IMAGINARY PART OF THE AIRY FUNCTION AI'(
z)
1295 c dair :
REAL part of the airy function ai
'(Z)
1297 C DZZ : (ABS(1-Z**2))**(1/2)
1298 C ETA : PSI/2**(1/3)
1302 C EXPAM : EXP(A*PI/2-FDOMIN)
1303 C EXPAPI : EXP(A*PI/2)
1304 C F2 : (-)**K/A**(2*K)
1305 C F4 : (A**(1/3))**4
1306 C FAC : FACTOR FOR THE KIA(X) FUNCTION
1307 C FACD : FACTOR FOR THE KIA'(
x) function
1308 c fdomin :
x*(
cos(thet)+thet*sin(thet))
1311 c *
IF ifaca=1, computation
of unscaled airy ai(
z),ai
'(Z)
1312 C *IF IFACA=2, COMPUTATION OF SCALED AIRY AI(Z),AI'(
z)
1314 c *
IF ifun=1, computation
of airy ai(
z)
1315 c *
IF ifun=2, computation
of airy ai
'(Z)
1316 C PHI : COEFFICIENTS FOR THE EXPANSION OF THE FUNCTION
1318 C PHIEX : EXACT VALUE OF THE FUNCTION PHI(PSI)
1319 C PHIEX2 : PHI(PSI)**2
1320 C PHIS : VALUE OF THE FUNCTION PHI(PSI)
1324 C *IF 0<=Z<=1, 2/3*PSI**3/2=LOG((1+SQRT(1-Z**2))/Z)
1326 C *IF Z>=1, 2/3*(-PSI)**3/2=SQRT(Z**2-1)-ARCCOS(1/Z)
1330 C SAS : ACCUMULATES THE CONTRIBUTION OF A_S(PSI)
1331 C SBS : ACCUMULATES THE CONTRIBUTION OF B_S(PSI)
1332 C SCS : ACCUMULATES THE CONTRIBUTION OF C_S(PSI)
1333 C SDS : ACCUMULATES THE CONTRIBUTION OF D_S(PSI)
1337 C UNDER : UNDERFLOW NUMBER
1342 C ZDS : SQRT(1-Z**2)
1343 C ZMASF : EXPANSION IN TERMS OF (Z-1) FOR THE
1344 C CALCULATION OF PSI(Z)
1345 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1346 DOUBLE PRECISION A,A0EX,A13,A2,A23,A2K,AC(0:5,0:20),
1347 + AII,AIR,APIHAL,ARG,AS,ASP,B0EX,B0PEX,BC(0:5,0:20),
1348 + BS,BSO,BSP,BSPO,C0EX,CHI,CHIEX,CHIN(0:26),COSTH,
1349 + COZMAS(0:12),D0EX,D1MACH,DAII,DAIR,DF,DKAI,DKAID
1350 DOUBLE PRECISION DZZ,ETA,ETAJ,ETAK,ETAL,EXPAM,
1351 + EXPAPI,F2,F4,FAC,FACD,FDOMIN,PHI(0:35),PHIEX,PHIEX2,
1352 + PHIS,PI,PIHALF,PSI,PSI12,PSI2,PSI3,SAS,SBS,SCS,SDS,
1353 + SIG,SINTH,THET,UNDER,X,Y,Z,Z2,Z21M,ZDS,ZMASF
1354 INTEGER IERRO,IERROK,IFAC,IFACA,IFUN,INDA(0:5),INDB(0:5),
1357 CCCC VALUES OF THE COEFFICIENTS
1358 DATA PHI/1.D0,0.2D0,.25714285714285714286D-1,
1359 + -.56507936507936507937D-2,-.39367965367965367965D-2,
1360 + -.5209362066504924D-3,.3708541264731741D-3,
1361 + .2123827840293627D-3,.2150629788753145D-4,
1362 + -.2636904062981799D-4,-.1405469826493129D-4,
1363 + -.1149328899029441D-5,.1972641193938624D-5,
1364 + .1014324305593329D-5,.7034331100192200D-7,
1365 + -.1525044777392676D-6,-.7677866256900572D-7,
1366 + -.4669842638693018D-8,.1206673645965329D-7,
1367 + .5990877668092344D-8,.3269102150077715D-9,
1368 + -.97138350244428335095D-9,-.47745934295232233834D-9,
1369 + -.23750318642839155779D-10,.79244598109106655567D-10,
1370 + .38653584230817865528D-10,.17734105846426807873D-11,
1371 + -.65332110030864751956D-11,-.31673512094772575686D-11,
1372 + -.13524195177121030660D-12,.54324103217903338951D-12,
1373 + .26204918647967626464D-12,.10488134973664584898D-13,
1374 + -.45490420121539001435D-13,-.21851238232690420878D-13,
1375 + -.82456080260379042800D-15/
1376 DATA CHIN/.2D0,.1142857142857142857142857D-1,
1377 + -.2438095238095238095238095D-1,-.1003471449185734900020614D-1,
1378 + .8811404468547325690182833D-3,.2318339655809043564145605D-2,
1379 + .7794494413564441575646057D-3,-.1373952504077228744949558D-3,
1380 + -.2162301322540308393022684D-3,-.6585004634375583559042795D-4,
1381 + .1502851367097217578058824D-4,.1991904617871647675455262D-4,
1382 + .5731972706719818525615427D-5,-.1496427612747891044606885D-5,
1383 + -.1821231830428939670133992D-5,-.5054254875930882534538217D-6,
1384 + .1433283859497625931203415D-6,.1657681319078678321113361D-6,
1385 + .4485592642702540575627044D-7,-.1346138242826094098161839D-7,
1386 + -.1504601862773535117708677D-7,-.3995660198654805921651406D-8,
1387 + .1250124931952495738882300D-8,.1363187174221864073749532D-8,
1388 + .3567608459777506132029204D-9,-.1152749290139859167119863D-9,
1389 + -.1233547289799408517691696D-9/
1390 DATA COZMAS/.9428090415820634D0,-.4242640687119285D0,
1391 + .2904188565587606D0,-.2234261009999160D0,
1392 + .1821754153944745D0,-.1539625154198624D0,
1393 + .1333737583085222D0,-.1176617834148007D0,
1394 + .1052687194772381D0,-.9524025714638822D-1,
1395 + .8695738197073783D-1,-.8000034897653656D-1,
1396 + .7407421797273086D-1/
1398 DATA AC(1,0)/-.44444444444444444445D-2/
1399 DATA AC(1,1)/-.18441558441558441558D-2/
1400 DATA AC(1,2)/.11213675213675213675D-2/
1401 DATA AC(1,3)/.13457752124418791086D-2/
1402 DATA AC(1,4)/.0003880626562979504D0/
1403 DATA AC(1,5)/-.0001830686723781799D0/
1404 DATA AC(1,6)/-.0001995460887806733D0/
1405 DATA AC(1,7)/-.00005256191234041587D0/
1406 DATA AC(1,8)/.00002460619652459158D0/
1407 DATA AC(1,9)/.00002519246780924541D0/
1408 DATA AC(1,10)/.6333157376533242D-5/
1409 DATA AC(1,11)/-.2957485733830202D-5/
1410 DATA AC(1,12)/-.2925255920564838D-5/
1411 DATA AC(1,13)/-.7159702610502009D-6/
1412 DATA AC(1,14)/.3331510720390949D-6/
1413 DATA AC(1,15)/.3227670475692310D-6/
1414 DATA AC(1,16)/.7767729381664199D-7/
1415 DATA AC(1,17)/-.3600954237921120D-7/
1416 DATA AC(1,18)/-.3441724449034226D-7/
1417 DATA AC(1,19)/-.8188194356398772D-8/
1418 DATA AC(1,20)/.3783148485152038D-8/
1419 DATA AC(2,0)/.69373554135458897365D-3/
1420 DATA AC(2,1)/.46448349036584330703D-3/
1421 DATA AC(2,2)/-.42838130171535112460D-3/
1422 DATA AC(2,3)/-.0007026702868771135D0/
1423 DATA AC(2,4)/-.0002632580046778811D0/
1424 DATA AC(2,5)/.0001663853666288703D0/
1425 DATA AC(2,6)/.0002212087687818584D0/
1426 DATA AC(2,7)/.00007020345615329662D0/
1427 DATA AC(2,8)/-.00004000421782540614D0/
1428 DATA AC(2,9)/-.00004786324966453962D0/
1429 DATA AC(2,10)/-.00001394600741473631D0/
1430 DATA AC(2,11)/.7536186591273727D-5/
1431 DATA AC(2,12)/.8478502161067667D-5/
1432 DATA AC(2,13)/.2345355228453912D-5/
1433 DATA AC(2,14)/-.1225943294710883D-5/
1434 DATA AC(2,15)/-.1325082343401027D-5/
1435 DATA AC(2,16)/-.3539954776569997D-6/
1436 DATA AC(2,17)/.1808291719376674D-6/
1437 DATA AC(2,18)/.1900383515233655D-6/
1438 DATA AC(3,0)/-.35421197145774384076D-3/
1439 DATA AC(3,1)/-.31232252789031883276D-3/
1440 DATA AC(3,2)/.3716442237502298D-3/
1441 DATA AC(3,3)/.0007539269155977733D0/
1442 DATA AC(3,4)/.0003408300059444739D0/
1443 DATA AC(3,5)/-.0002634968172069594D0/
1444 DATA AC(3,6)/-.0004089275726648432D0/
1445 DATA AC(3,7)/-.0001501108759563460D0/
1446 DATA AC(3,8)/.00009964015205538056D0/
1447 DATA AC(3,9)/.0001352492955751283D0/
1448 DATA AC(3,10)/.00004443117087272903D0/
1449 DATA AC(3,11)/-.00002713205071914117D0/
1450 DATA AC(3,12)/-.00003396796969771860D0/
1451 DATA AC(3,13)/-.00001040708865273043D0/
1452 DATA AC(3,14)/.6024639065414414D-5/
1453 DATA AC(3,15)/.7143919607846883D-5/
1454 DATA AC(4,0)/.378194199201773D-3/
1455 DATA AC(4,1)/.000404943905523634D0/
1456 DATA AC(4,2)/-.000579130526946453D0/
1457 DATA AC(4,3)/-.00138017901171011D0/
1458 DATA AC(4,4)/-.000722520056780091D0/
1459 DATA AC(4,5)/.000651265924036825D0/
1460 DATA AC(4,6)/.00114674563328389D0/
1461 DATA AC(4,7)/.000474423189340405D0/
1462 DATA AC(4,8)/-.000356495172735468D0/
1463 DATA AC(4,9)/-.000538157791035111D0/
1464 DATA AC(4,10)/-.000195687390661225D0/
1465 DATA AC(4,11)/.000132563525210293D0/
1466 DATA AC(4,12)/.000181949256267291D0/
1467 DATA AC(5,0)/-.69114139728829416760D-3/
1468 DATA AC(5,1)/-.00085995326611774383285D0/
1469 DATA AC(5,2)/.0014202335568143511489D0/
1470 DATA AC(5,3)/.0038535426995603052443D0/
1471 DATA AC(5,4)/.0022752811642901374595D0/
1472 DATA AC(5,5)/-.0023219572034556988366D0/
1473 DATA AC(5,6)/-.0045478643394434635622D0/
1474 DATA AC(5,7)/-.0020824431758272449919D0/
1475 DATA AC(5,8)/.0017370443573195808719D0/
1476 DATA BC(0,0)/.14285714285714285714D-1/
1477 DATA BC(0,1)/.88888888888888888889D-2/
1478 DATA BC(0,2)/.20482374768089053803D-2/
1479 DATA BC(0,3)/-.57826617826617826618D-3/
1480 DATA BC(0,4)/-.60412089799844901886D-3/
1481 DATA BC(0,5)/-.0001472685745626922D0/
1482 DATA BC(0,6)/.00005324102148009784D0/
1483 DATA BC(0,7)/.00005206561006583416D0/
1484 DATA BC(0,8)/.00001233115050894939D0/
1485 DATA BC(0,9)/-.4905932728531366D-5/
1486 DATA BC(0,10)/-.4632230987136350D-5/
1487 DATA BC(0,11)/-.1077174523455235D-5/
1488 DATA BC(0,12)/.4475963978932822D-6/
1489 DATA BC(0,13)/.4152586188464624D-6/
1490 DATA BC(0,14)/.9555819293589234D-7/
1491 DATA BC(0,15)/-.4060599208403059D-7/
1492 DATA BC(0,16)/-.3731367187988482D-7/
1493 DATA BC(0,17)/-.8532670645553778D-8/
1494 DATA BC(0,18)/.3673017245573624D-8/
1495 DATA BC(0,19)/.3355960460784536D-8/
1496 DATA BC(0,20)/.7643107095110475D-9/
1497 DATA BC(1,0)/-.11848595848595848596D-2/
1498 DATA BC(1,1)/-.13940630797773654917D-2/
1499 DATA BC(1,2)/-.48141005586383737645D-3/
1500 DATA BC(1,3)/.26841705366016142958D-3/
1501 DATA BC(1,4)/.0003419706982709903D0/
1502 DATA BC(1,5)/.0001034548234902078D0/
1503 DATA BC(1,6)/-.00005418191982095504D0/
1504 DATA BC(1,7)/-.00006202184830690167D0/
1505 DATA BC(1,8)/-.00001724885886056087D0/
1506 DATA BC(1,9)/.8744675992887053D-5/
1507 DATA BC(1,10)/.9420684216180929D-5/
1508 DATA BC(1,11)/.2494922112085850D-5/
1509 DATA BC(1,12)/-.1238458608836357D-5/
1510 DATA BC(1,13)/-.1285461713809769D-5/
1511 DATA BC(1,14)/-.3299710862537507D-6/
1512 DATA BC(1,15)/.1613441105788315D-6/
1513 DATA BC(1,16)/.1633623194402374D-6/
1514 DATA BC(1,17)/.4104252949605779D-7/
1515 DATA BC(1,18)/-.1984317042326989D-7/
1516 DATA BC(1,19)/-.1973948142769706D-7/
1517 DATA BC(1,20)/-.4882194808588752D-8/
1518 DATA BC(2,0)/.43829180944898810994D-3/
1519 DATA BC(2,1)/.71104865116708668943D-3/
1520 DATA BC(2,2)/.31858383945387580576D-3/
1521 DATA BC(2,3)/-.0002404809426804458D0/
1522 DATA BC(2,4)/-.0003722966038621536D0/
1523 DATA BC(2,5)/-.0001352752059595618D0/
1524 DATA BC(2,6)/.00008691694372704142D0/
1525 DATA BC(2,7)/.0001158750753591377D0/
1526 DATA BC(2,8)/.00003724965927846447D0/
1527 DATA BC(2,9)/-.00002198334949606935D0/
1528 DATA BC(2,10)/-.00002686449633870452D0/
1529 DATA BC(2,11)/-.8023061612032524D-5/
1530 DATA BC(2,12)/.4494756592180126D-5/
1531 DATA BC(2,13)/.5193504763856015D-5/
1532 DATA BC(2,14)/.1477156191529617D-5/
1533 DATA BC(2,15)/-.7988793826096784D-6/
1534 DATA BC(3,0)/-.37670439477105454219D-3/
1535 DATA BC(3,1)/-.75856271658798642365D-3/
1536 DATA BC(3,2)/-.0004103253968775048D0/
1537 DATA BC(3,3)/.0003791263310429010D0/
1538 DATA BC(3,4)/.0006850981673903450D0/
1539 DATA BC(3,5)/.0002878310571932216D0/
1540 DATA BC(3,6)/-.0002157010636115705D0/
1541 DATA BC(3,7)/-.0003260863991373500D0/
1542 DATA BC(3,8)/-.0001181317008748678D0/
1543 DATA BC(3,9)/.00007887526841582582D0/
1544 DATA BC(3,10)/.0001072081833420685D0/
1545 DATA BC(3,11)/.00003544595251288735D0/
1546 DATA BC(3,12)/-.00002201447920733824D0/
1547 DATA BC(3,13)/-.00002789336359620813D0/
1548 DATA BC(4,0)/.00058453330122076187255D0/
1549 DATA BC(4,1)/.0013854690422372401251D0/
1550 DATA BC(4,2)/.00086830374184946900245D0/
1551 DATA BC(4,3)/-.00093502904801345951693D0/
1552 DATA BC(4,4)/-.0019175486005525492059D0/
1553 DATA BC(4,5)/-.00090795047113308137941D0/
1554 DATA BC(4,6)/.00077050429806392235104D0/
1555 DATA BC(4,7)/.0012953100128255983488D0/
1556 DATA BC(4,8)/.00051933869471899550762D0/
1557 DATA BC(4,9)/-.00038482631948759834653D0/
1558 DATA BC(4,10)/-.00057335393099012476502D0/
1559 DATA BC(5,0)/-.0014301070053470410656D0/
1560 DATA BC(5,1)/-.0038637811942002539408D0/
1561 DATA BC(5,2)/-.0027322816261168328245D0/
1562 DATA BC(5,3)/.0033294980346743452748D0/
1563 DATA BC(5,4)/.0075972237660887795911D0/
1564 DATA BC(5,5)/.0039816655673062060620D0/
1565 DATA BC(5,6)/-.0037510180460986006595D0/
1566 DATA INDA/0,20,18,15,12,8/
1567 DATA INDB/20,20,15,13,10,6/
1568 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
1569 UNDER=D1MACH(1)*1.D+8
1570 CCCC CONSTANTS CCCCCCCCCCCCCC
1574 .EQ.
IF (IFAC1) THEN
1579 FDOMIN=X*(COSTH+THET*SINTH)
1580 .LE.
IF (-FDOMINLOG(UNDER)) IERROK=1
1582 .LE.
IF ((-PI*A*0.5D0)LOG(UNDER)) IERROK=1
1585 .EQ.
IF (IERROK0) THEN
1586 DF=2.D0**(1.D0/3.D0)
1587 CCCC VARIABLES CCCCCCCCCCCCCCC
1592 .EQ.
IF (IFAC1) THEN
1596 FACD=2.D0*PI*EXPAPI/Z/A23
1605 FDOMIN=X*(COSTH+THET*SINTH)
1606 EXPAM=EXP(-A*PIHALF+FDOMIN)
1608 FACD=2.D0*PI*EXPAM/Z/A23
1612 .LE.
IF (Z0.9D0) THEN
1613 ZDS=SQRT((1.D0-Z)*(1.D0+Z))
1614 PSI=(1.5D0*(LOG((1.D0+ZDS)/Z)-ZDS))**(2.D0/3.D0)
1615 .GT.
ELSEIF (Z1.1D0) THEN
1616 ZDS=SQRT((Z-1.D0)*(1.D0+Z))
1617 PSI=-(1.5D0*(ZDS-ACOS(1.D0/Z)))**(2.D0/3.D0)
1623 ZMASF=COZMAS(J)+Y*ZMASF
1625 ZMASF=ABS(Y)**(1.5D0)*ZMASF
1626 .LT.
IF (Z1.D0) THEN
1627 PSI=(1.5D0*ZMASF)**(2.D0/3.D0)
1629 PSI=-(1.5D0*ZMASF)**(2.D0/3.D0)
1636 .GT..AND..LT.
IF ((Z0.8D0)(Z1.2D0)) THEN
1651 CHI=CHI+CHIN(L)*ETAL
1670 PHIS=PHIS+PHI(K)*ETAK
1679 .LE.
IF (JINDA(K)) THEN
1682 .LE.
IF (JINDB(K)) THEN
1685 .LE.
IF ((J+1)INDA(K)) THEN
1686 ASP=ASP+(J+1)*AC(K,J+1)*ETAJ
1688 .LE.
IF ((J+1)INDB(K)) THEN
1689 BSP=BSP+(J+1)*BC(K,J+1)*ETAJ
1696 SDS=SDS-(CHI*AS+ASP+PSI*BS)*F2
1698 .GT..AND..LE.
IF ((K0)(K6)) THEN
1699 SCS=SCS+(AS+CHI*BSO+BSPO)*F2
1705 CCCC EXACT VALUES CCCCCCCCCCCCCCCCCCCCC
1708 PHIEX=(4.D0*PSI/Z21M)**0.25D0
1711 B0EX=-5.D0/48.D0/(PSI*PSI)+PHIEX2/48.D0/PSI*
1713 CHIEX=0.25D0/PSI*(1.D0-Z2*PHIEX2**3*0.25D0)
1715 D0EX=-(7.D0/48.D0/PSI+PHIEX2/48.D0*
1717 .GT.
IF (PSI0.D0) THEN
1724 B0PEX=5.D0/24.D0/PSI3+PHIEX2/48.D0*((2.D0*CHI*PSI-1.D0)/
1725 + PSI2*(5.D0/Z21M-3.D0)-10.D0*Z2*PSI12/
1753 .LE.
IF (JINDA(K)) THEN
1756 .LE.
IF (JINDB(K)) THEN
1759 .LE.
IF ((J+1)INDA(K)) THEN
1760 ASP=ASP+(J+1)*AC(K,J+1)*ETAJ
1762 .LE.
IF ((J+1)INDB(K)) THEN
1763 BSP=BSP+(J+1)*BC(K,J+1)*ETAJ
1770 SDS=SDS-(CHI*AS+ASP+PSI*BS)*F2
1773 SCS=SCS+(AS+CHI*BSO+BSPO)*F2
1775 SCS=SCS+(AS+CHI*B0EX+B0PEX)*F2
1780 CCCCC CALL THE AIRY ROUTINE CCCCCCCCC
1783 CALL AIZ(IFUN,IFACA,ARG,0.D0,AIR,AII,IERRO)
1786 CALL AIZ(IFUN,IFACA,ARG,0.D0,DAIR,DAII,IERRO)
1787 DKAI=FAC*PHIS*(AIR*SAS+DAIR*SBS/F4)
1788 DKAID=FACD/PHIS*(DAIR*SCS+AIR*SDS/A23)
1796 SUBROUTINE DLIA(IFAC,X,A,DLI,DLID,IERRO)
1797 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1798 CCCC THE PURPOUSE OF THE ROUTINE IS THE CALCULATION OF THE
1799 CCCC MODIFIED BESSEL FUNCTIONS L_IA(X) AND L'_ia(
x),
1800 cccc
WHERE i
is the imaginary
unit and
x is the argument
of the
1801 cccc functions. we will refer
to a
as the order
of the functions.
1803 cccc the routine has the
option of computing scaled functions.
1806 cccc the scaled functions are defined
as follows:
1807 cccc(
s stands
for scaled and
1808 cccc l=sqrt{
x**2-a**2} + a*arcsin(a/
x)):
1810 cccc exp(-l)*l_ia(
x),
IF x >=abs(a)
1812 cccc exp(-abs(a)*
pi/2)*l_ia(
x),
IF x < abs(a)
1815 cccc exp(-l)*l
'_IA(X), IF X >=ABS(A)
1817 cccc exp(-abs(a)*
pi/2)*l
'_IA(X), IF X <ABS(A)
1819 CCCC THE RANGE OF THE PARAMETERS (X,A) FOR THE COMPUTATION IS:
1820 CCCC 0 < X <= 1500, -1500 <= A <= 1500
1821 CCCC FOR FUNCTIONS WITHOUT SCALING, THE RANGE IS USUALLY LARGER
1823 CCCC 0 < X <= 500, -400 <= A <= 400,
1824 CCCC DEPENDING ON THE MACHINE OVERFLOW/UNDERFLOW PARAMETERS, WHICH
1825 CCCC ARE SET UP BY THE ROUTINE D1MACH.
1826 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1827 CCCC METHODS OF COMPUTATION:
1828 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1830 CCCC IF ABS(A) > 0.044*ABS(X-3.1)**1.9+(X-3.1) OR
1831 CCCC ABS(A) <= 25 AND X <= 60
1832 CCCC 2) ASYMPTOTIC EXPANSION, IF ABS(A) < 0.7*X-10
1833 CCCC 3) AIRY-TYPE ASYMPTOTIC EXPANSION,
1834 CCCC IF ABS(A) < 3.7*X-10
1835 CCCC 4) QUADRATURES,
1836 CCCC IN THE REST OF THE PLANE (X,A)
1837 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1838 CCCC DESCRIPTION OF INPUT/OUTPUT VARIABLES:
1839 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1841 CCCC X : ARGUMENT OF THE FUNCTIONS
1842 CCC A : ORDER OF THE FUNCTIONS
1843 CCCC IFAC: INTEGER FLAG FOR THE SCALING
1844 CCCC * IFAC=1, THE CODE COMPUTES L_IA(X), L'_ia(
x)
1845 cccc * otherwise, the code computes scaled l_ia(
x), l
'_IA(X)
1847 CCCC DLI : LIA(X) FUNCTION
1848 CCCC DLID : DERIVATIVE OF THE LIA(X) FUNCTION
1849 CCCC IERRO: ERROR FLAG
1850 CCCC * IF IERRO=0, COMPUTATION SUCCESSFUL.
1851 CCCC * IF IERRO=1, COMPUTATION OUT OF RANGE.
1852 CCCC * IF IERRO=2, ARGUMENT X AND/OR ORDER A OUT OF RANGE.
1853 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1855 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1856 CCCC THE RELATIVE ACCURACY IS:
1857 CCCC BETTER THAN 10**(-13) FOR (X,A) IN (0,200]X[-200,200];
1858 CCCC BETTER THAN 5.10**(-13) FOR (X,A) IN (0,500]X[-500,500];
1859 CCCC CLOSE TO 10**(-12) FOR (X,A) IN (0,1500]X[-1500,1500].
1860 CCCC NEAR THE ZEROS OF THE FUNCTIONS (THERE ARE INFINITELY
1861 CCCC MANY OF THEM IN THE OSCILLATORY REGION) RELATIVE PRECISION
1862 CCCC LOOSES MEANING AND ONLY ABSOLUTE PRECISION MAKES SENSE.
1863 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1865 C AMPARO GIL (U. CANTABRIA, SANTANDER, SPAIN).
1866 C E-MAIL: AMPARO.GIL@UNICAN.ES
1867 C JAVIER SEGURA (U. CANTABRIA, SANTANDER, SPAIN).
1868 C E-MAIL: SEGURAJJ@UNICAN.ES
1869 C NICO M. TEMME (CWI, AMSTERDAM, THE NETHERLANDS).
1870 C E-MAIL: NICO.TEMME@CWI.NL
1871 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1873 C THIS IS THE COMPANION SOFTWARE OF THE ARTICLES
1874 C 1)'computing solutions
of the modified bessel differential
1875 c equation
for imaginary orders and positive arguments
',
1876 C A. GIL, J. SEGURA, N.M. TEMME
1877 C ACM TRANS. MATH. SOFT. (2004)
1878 C 2)'modified bessel functions
of imaginary order and
1879 c positive argument
',
1880 C A. GIL, J. SEGURA, N.M. TEMME
1881 C ACM TRANS. MATH. SOFT. (2004)
1882 C ADDITIONAL REFERENCES:
1883 C - 'computation
of the modified bessel
FUNCTION of the
1884 c third kind
for imaginary orders
'
1885 C A. GIL, J. SEGURA, N.M. TEMME
1886 C J. COMPUT. PHYS. 175 (2002) 398-411
1887 C - 'computation
of the modified bessel functions
of the
1888 c third kind
of imaginary orders:
1889 c uniform airy-
TYPE asymptotic expansion
'
1890 C A. GIL, J. SEGURA, N.M. TEMME, PROCEEDINGS OPSFA 2001
1891 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1892 CCC LOCAL VARIABLES:
1893 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1895 C DF1: 0.044*ABS(D)**1.9+(X-3.1)
1898 C PNU: ORDER OF THE FUNCTION
1899 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1900 DOUBLE PRECISION A,D,DF1,DF2,DF3,DLI,DLID,PNU,X
1904 .GT..OR..LE.
IF ((X1500.D0)(X0.D0)) THEN
1909 .GT.
IF (ABS(PNU)1500.D0) THEN
1914 .EQ.
IF (IERRO0) THEN
1915 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1916 CCC THESE FUNCTIONS ARE EVEN FUNCTIONS IN THE C
1917 CCC PARAMETER A (=PNU) C
1918 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1919 .LT.
IF (PNU0.D0) PNU=-PNU
1921 DF1=0.044D0*ABS(D)**1.9D0+D
1924 .GT..OR..LE..AND..LE.
IF ((PNUDF1)(((PNU25.D0)(X60.D0))))
1926 CALL SERLIA(IFAC,X,PNU,DLI,DLID,IERRO)
1927 .LT.
ELSEIF (PNUDF2) THEN
1928 CALL EXPLIA(IFAC,X,PNU,DLI,DLID,IERRO)
1929 .LT.
ELSEIF (PNUDF3) THEN
1930 CALL AIEXLI(IFAC,X,PNU,DLI,DLID,IERRO)
1932 CALL DLINT(IFAC,X,PNU,DLI,DLID,IERRO)
1938 SUBROUTINE DLINT(IFAC,XX,PNUA,DLINF,DLIND,IERRO)
1939 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1940 CCC CALCULATION OF L, L' using non-oscillating
integral c
1941 ccc representations
c
1944 ccc xx: argument
of the functions
c
1945 ccc pnua: order
of the functions
c
1947 ccc =1, non scaled functions
c
1948 ccc otherwise, scaled functions
c
1950 ccc dlinf: l
FUNCTION c
1951 ccc dlind: derivative
of the l
FUNCTION c
1953 ccc *
IF ierro=0, computation successful.
c
1954 ccc *
IF ierro=1, computation out
of range.
c
1955 ccc *
IF ierro=2, argument and/or order, out
of range.
c
1956 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1957 ccc method
of computation:
1958 ccc * xx<pnua: the non-oscillating
integral representations
1959 ccc
for the oscillatory region are used
1960 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1961 ccc local variables:
1962 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1963 c chi :
x*sinh(mu)-pnu*mu
1964 c contr1 : contribution
of the semi-infinite
integral
1965 c in the oscillatory
CASE (including additional
1966 c factors: contr1=fos1*factors).
1968 c cosh2m : cosh(2*mu)
1970 c df1 :
factor(depending on ifac)
1971 c dff : (1-exp(-2*
pi*pnu))*exp(-eta)
1972 c dmain :
pi*pnu*0.5
1973 c dmu : solution mu
of cosh(mu)=pnu/
x
1979 c dmufac : mu*cosh(mu)-sinh(mu)
1980 c dmutan : mu-tanh(mu)
1981 c expo : exp(
pi*pnu*0.5)
1982 c fos1 : contribution
of the semi-infinite
integral
1983 c in the oscillatory
CASE (lia(
x)).
1984 c fosd1 : contribution
of the semi-infinite
integral
1985 c in the oscillatory
CASE (lia
'(X)).
1986 C OVER : OVERFLOW NUMBER
1989 C PNUA : SAME AS PNU (INPUT VARIABLE)
1991 C SINH2M : SINH(2*MU)
1993 C UNDER : UNDERFLOW NUMBER
1994 C X : ARGUMENT OF THE FUNCTION
1995 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1996 DOUBLE PRECISION CHI,CONTR1,COSCHI,COSH2M,COSHM,
1997 + D1MACH,DF1,DFF,DLIND,DLINF,DMAIN,DMU,DMU2,DMU3,
1998 + DMU5,DMU7,DMU9,DMUFAC,DMUTAN,EXPO,FOS1,FOSD1,OVER,
1999 + PI,PINU,PNU,PNUA,SINCHI,SINH2M,SINHM,UNDER,X,XX
2002 COMMON/PAROS1/DMU,COSHM,SINHM,DMUFAC,COSCHI,SINCHI
2003 COMMON/PAROS2/COSH2M,SINH2M,DMAIN
2004 COMMON/PAROS3/DMUTAN
2005 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
2006 OVER=D1MACH(2)*1.D-8
2007 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
2008 UNDER=D1MACH(1)*1.D+8
2013 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2014 CC THE USE OF INTEGRALS FOR THE LIA FUNCTION IS C
2015 CC RESTRICTED TO THE CASE X < A, WHICH IS THE C
2016 CC OSCILLATORY CASE C
2017 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2019 .EQ.
IF (IFAC1) THEN
2020 .GE.
IF ((PI*PNU*0.5D0)LOG(OVER)) IERRO=1
2022 .EQ.
IF (IERRO0) THEN
2024 DMU=LOG(COSHM+SQRT((COSHM-1.D0)*(COSHM+1.D0)))
2029 .GT.
IF (DMU0.1D0) THEN
2031 DMUFAC=DMU*COSHM-SINHM
2038 CHI=-2.D0*X*(1.D0/6.D0*DMU3+1.D0/60.D0*DMU5+
2039 + 3.D0/5040.D0*DMU7+4.D0/362880.D0*DMU9)
2040 DMUFAC=DMU3/3.D0+DMU5/30.D0+DMU7/840.D0+DMU9/45360.D0
2042 DMUTAN=DMU-TANH(DMU)
2051 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2052 CCC THEN, THE LIA FUNCTION IS GIVEN BY ... CC
2053 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2054 .EQ.
IF (IFAC1) THEN
2057 .LE.
IF ((-2.D0*PINU)LOG(UNDER)) THEN
2060 DF1=DFF*(1.D0-EXP(-2.D0*PINU))*0.5D0
2065 .LE.
IF ((-2.D0*PINU)LOG(UNDER)) THEN
2068 DF1=DFF*(1.D0-EXP(-2.D0*PINU))*0.5D0
2073 CCCCCCCCCCCCCCCCCCCCCCCCCC
2074 CCC CALCULATION OF LIA' cc
2075 cccccccccccccccccccccccccc
2079 CALL traprl(10,fosd1)
2080 ccccccccccccccccccccccccccccccccccccccccccccc
2081 ccc
THEN, the lia
FUNCTION is given by ... cc
2082 ccccccccccccccccccccccccccccccccccccccccccccc
2086 IF ((-2.d0*pinu).LE.
log(under))
THEN
2089 df1=dff*(1.d0-exp(-2.d0*pinu))*0.5d0
2094 IF ((-2.d0*pinu).LE.
log(under))
THEN
2097 df1=dff*(1.d0-exp(-2.d0*pinu))*0.5d0
2109 DOUBLE PRECISION FUNCTION fstal2(T)
2110 ccccccccccccccccccccccccccccccccccccccccccccccccc
2114 ccc
'COMPUTING SOLUTIONS OF THE MODIFIED BESSEL
2115 CCC DIFFERENTIAL EQUATION FOR IMAGINARY ORDERS
2116 CCC AND POSITIVE ARGUMENTS',
2117 ccc a. gil, j. segura,
n.m. temme
2118 ccc acm trans. math. soft. (2004)
2119 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2121 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2122 c t : argument
of the
FUNCTION
2123 c(variable
of integration).
2124 ccccccccccccccccccccccccccccccccccccccccccccccccc
2125 ccc local variables:
2126 ccccccccccccccccccccccccccccccccccccccccccccccccc
2127 c argu : (cosh(mu)*u-dmufac)/sinh(u)
2129 c coschi : cosh(chi), chi=
x*sinh(mu)-pnu*mu
2130 c cosh2m : cosh(2*mu)
2132 c d1 : cosh(mu)-dmufac
2133 c deri : (cosh(mu)/sinh(u)-d1*cosh(u)/sinh(u)**2)
2135 c djaco : cosh(
t)*exp(
s)/sqrt(1+exp(
s)**2)
2136 c dmain :
pi*pnu*0.5
2137 c dmu : solution mu
of cosh(mu)=pnu/
x
2139 c dmufac : mu*cosh(mu)-sinh(mu)
2140 c expon : exp(-(phib(u)-
pi*pnu*0.5))
2141 c f1 : sinh(u-mu)/(u-mu)
2142 c g1 :
z/6+z3/120+z5/5040+z7/362880,
z=2*
y
2143 c phib(u) :
x*cosh(u)*
cos(sigma(u))+pnu*sigma(u),
2144 c WHERE x=argument
of the function,
2145 c sigma(u)=arcsin((cosh(mu)*u-dmufac)/sinh(u)
2146 c resto : sin(chi)-
cos(chi)*deri
2149 c sinh2m : sinh(2*mu)
2152 c sinhu2 : 2*sinh(u)
2153 c u : mu+
log(
x+sqrt(
x**2+1))
2162 cccccccccccccccccccccccccccccccccccccccccccccccccccccc
2163 DOUBLE PRECISION argu,argu2,coschi,cosh2m,coshm,
2164 + d1,
d1mach,deri,djaco,dmain,dmu,dmu2,dmufac,dmutan,
2165 + expon,f1,g1,phib,resto,
s,sinchi,sinh2m,sinhm,
2166 + sinhu,sinhu2,
t,u,under,
x,
y,
z,
z2,z3,z5,z7
2167 common/paros1/dmu,coshm,sinhm,dmufac,coschi,sinchi
2168 common/paros2/cosh2m,sinh2m,dmain
2169 common/paros3/dmutan
2170 ccc machine dependent constant(
underflow number)
2174 u=dmutan+
log(
x+sqrt(
x*
x+1.d0))
2176 IF (abs(
y).LE.0.1d0)
THEN
2177 IF (abs(
y).GT.under)
THEN
2187 g1=
z/6.d0+z3/120.d0+z5/5040.d0+z7/362880.d0
2189 deri=sinh(u)/(f1-coshm*cosh(u))*
2190 + sqrt(cosh(dmu2)*f1*f1+2.d0*sinh(dmu2)*g1-
2199 deri=1.d0/sqrt(1.d0-argu2)*
2200 + (coshm/sinhu-d1*cosh(u)/sinhu2)
2201 IF (u.LT.dmu) deri=-deri
2203 djaco=cosh(
t)*
x/sqrt(1.d0+
x*
x)
2204 IF ((-(phib(u)-dmain)).LE.
log(under))
THEN
2208 expon=exp(-(phib(u)-dmain))
2209 resto=(sinchi-coschi*deri)
2210 fstal2=expon*resto*djaco
2215 DOUBLE PRECISION FUNCTION fdtal2(T)
2216 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2219 ccc
in eq.(37)
of the reference:
2220 ccc
'COMPUTING SOLUTIONS OF THE MODIFIED BESSEL
2221 CCC DIFFERENTIAL EQUATION FOR IMAGINARY ORDERS
2222 CCC AND POSITIVE ARGUMENTS',
2223 ccc a. gil, j. segura,
n.m. temme
2224 ccc acm trans. math. soft. (2004)
2225 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2227 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2228 c t : argument
of the
FUNCTION
2229 c(variable
of integration).
2230 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2231 ccc local variables:
2232 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2233 c argu : (cosh(mu)*u-dmufac)/sinh(u)
2235 c coschi : cosh(chi), chi=
x*sinh(mu)-pnu*mu
2236 c cosh2m : cosh(2*mu)
2239 c coss :
cos(sigma(u))
2240 c d1 : cosh(mu)-dmufac
2241 c delta : -sin(chi)*
cos(sigma(u))*cosh(u)
2242 c +
cos(chi)*sin(sigma(u))*sinh(u)
2243 c deri : (cosh(mu)/sinh(u)-d1*cosh(u)/sinh(u)**2)
2245 c djaco : cosh(
t)*exp(
s)/sqrt(1+exp(
s)**2)
2246 c dmain :
pi*pnu*0.5
2247 c dmu : solution mu
of cosh(mu)=pnu/
x
2249 c dmufac : mu*cosh(mu)-sinh(mu)
2250 c expon : exp(-(phib(u)-
pi*pnu*0.5))
2251 c f1 : sinh(u-mu)/(u-mu)
2252 c g1 :
z/6+z3/120+z5/5040+z7/362880,
z=2*
y
2253 c gamma : sin(chi)*sin(sigma(u))*sinh(u)+
2254 c cos(chi)*
cos(sigma(u))*cosh(u)
2255 c phib(u) :
x*cosh(u)*
cos(sigma(u))+pnu*sigma(u),
2256 c WHERE x=argument
of the function,
2257 c sigma(u)=arcsin((cosh(mu)*u-dmufac)/sinh(u)
2258 c resto : -sin(chi)*
cos(sigma(u))*cosh(u)
2259 c +
cos(chi)*sin(sigma(u))*sinh(u)+
2260 c(sin(chi)*sin(sigma(u))*sinh(u)+
2261 c cos(chi)*
cos(sigma(u))*cosh(u))*deri
2263 c sigma(u): asin((cosh(mu)*u-dmufac)/sinh(u))
2266 c sinh2m : sinh(2*mu)
2269 c sinhu2 : 2*sinh(u)
2270 c sins : sin(sigma(u))
2271 c u : mu+
log(
x+sqrt(
x**2+1))
2280 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2281 DOUBLE PRECISION argu,argu2,coschi,cosh2m,coshm,
2282 + coshu,coss,d1,
d1mach,delta,deri,djaco,dmain,dmu,
2283 + dmu2,dmufac,dmutan,expon,f1,g1,
gamma,phib,resto,
2284 +
s,sigma,sigmau,sinchi,sinh2m,sinhm,sinhu,sinhu2,
2285 + sins,
t,u,under,
x,
y,
z,
z2,z3,z5,z7
2286 common/paros1/dmu,coshm,sinhm,dmufac,coschi,sinchi
2287 common/paros2/cosh2m,sinh2m,dmain
2288 common/paros3/dmutan
2289 ccc machine dependent constant(
underflow number)
2293 u=dmutan+
log(
x+sqrt(
x*
x+1.d0))
2297 IF (abs(
y).LE.0.1)
THEN
2298 IF (abs(
y).GT.under)
THEN
2308 g1=
z/6.d0+z3/120.d0+z5/5040.d0+z7/362880.d0
2310 deri=sinhu/(f1-coshm*coshu)*sqrt(cosh(dmu2)*f1*f1+
2311 + 2.d0*sinh(dmu2)*g1-coshm*coshm)
2318 deri=1.d0/sqrt(1.d0-argu2)*(coshm/sinhu-
2320 IF (u.LT.dmu) deri=-deri
2322 djaco=cosh(
t)*
x/sqrt(1.d0+
x*
x)
2323 IF ((-(phib(u)-dmain)).LE.
log(under))
THEN
2327 expon=exp(-(phib(u)-dmain))
2331 gamma=sinchi*sins*sinhu+coschi*coss*coshu
2332 delta=-sinchi*coss*coshu+coschi*sins*sinhu
2333 resto=delta+
gamma*deri
2334 fdtal2=expon*resto*djaco
2339 SUBROUTINE traprl(IC,TI)
2340 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2341 ccc implementation
of an adaptive trapezoidal rule
2346 ccc ic: depending on the values
of ic,
2347 ccc different integrals are computed:
2348 ccc *ic=1, l function, oscillatory region
2349 ccc *ic=10, derivative
of the l function,
2350 ccc oscillatory region.
2353 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2355 cccccccccccccccccccccccccccccccccccccccccccccccccccc
2356 c a : lower integration limit
2357 c b : upper integration limit
2361 c h : integration step
2362 c pnu : order
of the
FUNCTION
2363 c sum : accumulates the elementary
2366 c x : argument
of the
FUNCTION
2367 c xac : integration abcissa
2368 ccccccccccccccccccccccccccccccccccccccccccccccccc
2369 DOUBLE PRECISION a,b,
d1mach,delta,
eps,fintel,
2370 + h,pnu,sum,ti,tin,
x,xac,
z
2376 ccccc integration limits: a,b
2378 IF ((
z.GT.0.999d0).AND.(
z.LT.1.001d0))
THEN
2385 ti=0.5d0*h*(fintel(ic,a)+fintel(ic,b))
2397 sum=sum+fintel(ic,xac)
2400 IF ((tin.NE.0.d0).AND.(
n.GT.4))
THEN
2401 delta=abs(1.d0-ti/tin)
2404 IF ((delta.GT.
eps).AND.(
n.LT.9)) goto 11
2408 DOUBLE PRECISION FUNCTION fintel(IC,T)
2409 ccccccccccccccccccccccccccccccccccccccccccccccccccc
2410 ccc auxiliary
FUNCTION for the subroutine traprl.
2411 ccc
this FUNCTION calls the different functions
2412 ccc containing the integrands which are integrated
2414 ccccccccccccccccccccccccccccccccccccccccccccccccccc
2417 ccc values are the same
as in the
c
2418 ccc
SUBROUTINE traprl.
c
2419 ccc
t: integration abscissa
c
2420 ccccccccccccccccccccccccccccccccccccccccccccccccccc
2421 ccc local variables:
2422 ccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2423 c fdtal2 : oscillatory
part: tau contribution routine
2424 c(lia
'(X) FUNCTION). SEMI-INFINITE INTEGRAL.
2425 C USED FOR LARGE PNU
2426 C FSTAL2 : OSCILLATORY PART: TAU CONTRIBUTION ROUTINE
2427 C (LIA(X) FUNCTION). SEMI-INFINITE INTEGRAL.
2428 C USED FOR LARGE PNU
2429 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2430 DOUBLE PRECISION FDTAL2,FSTAL2,T
2441 SUBROUTINE SERLIA(IFAC,X,PNU,PSER,PSERD,IERRO)
2442 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2443 CCC CALCULATION OF POWER SERIES FOR L, L'
2444 ccccccccccccccccccccccccccccccccccccccccccccccccccccc
2445 ccc input variables:
c
2446 ccc
x: argument
of the functions
c
2447 ccc pnu: order
of the functions
c
2449 ccc =1, non scaled functions
c
2450 ccc otherwise, scaled functions
c
2452 ccc pser: l
FUNCTION c
2453 ccc pserd: derivative
of the l
FUNCTION c
2455 ccc *
IF ierro=0, computation successful.
c
2456 ccc *
IF ierro=1, computation out
of range.
c
2457 ccc *
IF ierro=2, argument and/or order,
c
2459 ccccccccccccccccccccccccccccccccccccccccccccccccccccc
2460 ccc local variables:
2461 ccccccccccccccccccccccccccccccccccccccccccccccccccccc
2462 c a : order
of the functions
2466 c accp : accumulates the
p coefficients
2467 c accq : accumulates the q coefficients
2468 c argu : sig(0)-a*
log(
x/2)
2470 c coci : 1/(
k**2+a**2)
2472 c deltak : accumulates the contribution
for the
2474 c deltkp : accumulates the contribution
for the
2476 C DF1 : FACTOR (DEPENDING ON IFAC)
2477 C ETA0 : PARAMETER FOR THE CALCULATION OF THE
2478 C COULOMB PHASE SHIFT
2480 C F(K) : SIN(PHI(A,K)-A*LOG(X/2))
2481 C /(A**2*(1+A**2)...(K**2+A**2))**1/2,
2482 C WHERE PHI(A,K)=PHASE(GAMMA(1+K+IA))
2483 C FDOMIN : X*(COS(THET)+THET*SIN(THET))
2484 C K : CONTRIBUTION TO THE LIA(X) FUNCTION
2485 C KP : CONTRIBUTION TO THE LIA'(
x) function
2487 c p0 : parameters
for the calculation
of the coulomb
2489 c p1 : parameters
for the calculation
of the coulomb
2491 c p2 : parameters
for the calculation
of the coulomb
2497 c q0 : parameters
for the calculation
of the coulomb
2499 c q1 : parameters
for the calculation
of the coulomb
2501 c q2 : parameters
for the calculation
of the coulomb
2509 ccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2510 DOUBLE PRECISION a,
a2,a2h,a2n,accp,accq,argu,
c,coci,
2511 + costh,
d1mach,dds,dee,deltak,deltkp,df1,dsmall,eta0,
2512 + eta02,euler,f(0:500),fdomin,
k,kp,over,p0(0:9),p1(0:9),
2513 + p2(0:6),
pi,pia,pia2,pnu,preci,pser,pserd,q0(0:9),
2514 + q1(0:9),q2(0:6),
r(0:500),sig0,sinth,thet,under,
x,
x2
2515 INTEGER ierro,ifac,l,m,
n
2516 SAVE p0,q0,p1,q1,p2,q2
2517 DATA p0/1.08871504904797411683d5,3.64707573081160914640d5,
2518 + 4.88801471582878013158d5,3.36275736298197324009d5,
2519 + 1.26899226277838479804d5,
2520 + 2.60795543527084582682d4,2.73352480554497990544d3,
2521 + 1.26447543569902963184d2,
2522 + 1.85446022125533909390d0,1.90716219990037648146
d-3/
2523 DATA q0/6.14884786346071135090d5,2.29801588515708014282d6,
2524 + 3.50310844128424021934d6,
2525 + 2.81194990286041080264d6,1.28236441994358406742d6,
2526 + 3.35209348711803753154d5,
2527 + 4.84319580247948701171d4,3.54877039006873206531d3,
2528 + 1.11207201299804390166d2,1.d0/
2529 DATA p1/-1.044100987526487618670d10,-1.508574107180079913696d10,
2530 + -5.582652833355901160542d9,4.052529174369477275446d8,
2531 + 5.461712273118594275192d8,
2532 + 9.510404403068169395714d7,6.281126609997342119416d6,
2533 + 1.651178048950518520416d5,
2534 + 1.498824421329341285521d3,2.974686506595477984776d0/
2535 DATA q1/1.808868161493543887787d10,3.869142051704700267785d10,
2536 + 3.003264575147162634046d10,1.075554651494601843525d10,
2537 + 1.901298501823290694245d9,
2538 + 1.665999832151229472632d8,6.952188089169487375936d6,
2539 + 1.253235080625688652718d5,7.904420414560291396996d2,1.d0/
2540 DATA p2/7.08638611024520906826
d-3,-6.54026368947801591128
d-2,
2541 + 2.92684143106158043933
d-1,4.66821392319665609167d0,
2542 + -3.43943790382690949054d0,
2543 + -7.72786486869252994370d0,-9.88841771200290647461
d-01/
2544 DATA q2/-7.08638611024520908189
d-3,6.59931690706339630254
d-2,
2545 + -2.98754421632058618922
d-1,-4.63752355513412248006d0,
2546 + 3.79700454098863541593d0,7.06184065426336718524d0,1.d0/
2547 ccc machine dependent constant(
overflow number)
2549 ccc machine dependent constant(
underflow number)
2558 fdomin=
x*(costh+thet*sinth)
2559 IF (fdomin.GE.
log(over)) ierro=1
2561 IF ((
pi*pnu*0.5d0).GE.
log(over)) ierro=1
2564 IF (ierro.EQ.0)
THEN
2565 eta0=1.8055470716051069198764d0
2566 euler=0.577215664901532860606512d0
2568 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2570 ccc from cody & hillstrom, math. comput. 24(111) 1970
2571 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2584 sig0=a*(
a2-eta02)*accp/accq
2586 IF ((a.GT.2.d0).AND.(a.LE.4.d0))
THEN
2599 sig0=atan(a)*0.5d0+a*(
log(1.d0+
a2)*0.5d0+accp/accq)
2602 ccccccccccccccccccccccccccccccccccccc
2603 ccc evaluation
of f(0),
r(0),
r(1)
2604 ccccccccccccccccccccccccccccccccccccc
2607 argu=sig0-a*
log(
x*0.5d0)
2609 r(1)=1.d0/(1.d0+
a2)*(
r(0)-a*sin(argu))
2610 IF (a.LT.under)
THEN
2611 f(0)=-(euler+
log(
x*0.5d0))
2613 f(0)=1.d0/a*sin(argu)
2618 cccccccccccccccccccccccccccccccccccc
2620 cccccccccccccccccccccccccccccccccccc
2626 66 f(m)=(m*f(m-1)+
r(m-1))*coci
2630 deltkp=(m*
r(m)+a2h*f(m))*
c
2634 r(m)=((2.d0*m-1.d0)*
r(m-1)-
r(m-2))*coci
2636 IF ((abs(deltak/
k).GT.preci).OR.
2637 + (abs(deltkp/kp).GT.preci)) goto 66
2641 IF (-pia2.LE.
log(under))
THEN
2646 IF (a.LT.1.
d-1)
THEN
2647 IF (a.LT.under)
THEN
2654 dds=-dds*pia2/(l+1.d0)
2656 IF (abs(dds/dsmall).GT.preci) goto 47
2657 df1=exp(pia*0.5d0)*sqrt(dsmall)
2660 df1=exp(pia*0.5d0)*sqrt((1.d0-dee)/pia2)
2666 IF (-pia2.LE.
log(under))
THEN
2671 IF (a.LT.1.
d-1)
THEN
2672 IF (a.LT.under)
THEN
2679 dds=-dds*pia2/(l+1.d0)
2681 IF (abs(dds/dsmall).GT.preci) goto 48
2685 df1=sqrt((1.d0-dee)/pia2)
2691 fdomin=
x*(costh+thet*sinth)
2692 IF (-pia2.LE.
log(under))
THEN
2697 IF (a.LT.1.
d-1)
THEN
2698 IF (a.LT.under)
THEN
2705 dds=-dds*pia2/(l+1.d0)
2707 IF (abs(dds/dsmall).GT.preci) goto 49
2708 df1=exp(pia*0.5d0-fdomin)*sqrt(dsmall)
2711 df1=exp(pia*0.5d0-fdomin)*sqrt((1.d0-dee)/pia2)
2724 SUBROUTINE explia(IFAC,X,PNU,PEXP,PEXPP,IERRO)
2725 cccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2726 ccc calculation
of the asymptotic expansions
for c
2727 ccc the l, l
' FUNCTIONS C
2729 CCC INPUT VARIABLES: C
2730 CCC X: ARGUMENT OF THE FUNCTIONS C
2731 CCC PNU: ORDER OF THE FUNCTIONS C
2733 CCC =1, NON SCALED FUNCTIONS C
2734 CCC OTHERWISE, SCALED FUNCTIONS C
2735 CCC OUTPUT VARIABLES: C
2736 CCC PEXP: L FUNCTION C
2737 CCC PEXPP: DERIVATIVE OF THE L FUNCTION C
2738 CCC IERRO: ERROR FLAG C
2739 CCC * IF IERRO=0, COMPUTATION SUCCESSFUL. C
2740 CCC * IF IERRO=1, COMPUTATION OUT OF RANGE . C
2741 CCC * IF IERRO=2, ARGUMENT AND/OR ORDER, C
2743 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2744 CCC LOCAL VARIABLES:
2745 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2746 C A : ORDER OF THE FUNCTIONS
2749 C DELTAK : ACCUMULATES THE CONTRIBUTION FOR THE
2751 C DELTKP : ACCUMULATES THE CONTRIBUTION FOR THE
2753 c df :
factor(depending on ifac)
2754 c fdomin :
x*(
cos(thet)+thet*sin(thet))
2756 c k : contribution
to the lia(
x) function
2757 c kp : contribution
to the lia
'(X) FUNCTION
2758 C OVER : OVERFLOW NUMBER
2761 C PRECI : RELATIVE PRECISION USED IN THE CALCULATION
2762 C RAX(K+1) : -((K+1/2)**2+A**2)/(K+1)*RAX(K)
2764 C THET : ASIN(PNU/X)
2766 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2767 DOUBLE PRECISION A,A2,COSTH,D1MACH,DELTAK,
2768 + DELTKP,DF,FDOMIN,K,KP,OVER,PEXP,PEXPP,PI,PIA,
2769 + PNU,PRECI,RAX,SINTH,THET,X,XI
2770 INTEGER IERRO,IFAC,IND,M
2771 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
2772 OVER=D1MACH(2)*1.D-8
2775 .EQ.
IF (IFAC1) THEN
2780 FDOMIN=X*(COSTH+THET*SINTH)
2781 .GE.
IF (FDOMINLOG(OVER)) IERRO=1
2783 .GE.
IF ((PI*PNU*0.5D0)LOG(OVER)) IERRO=1
2786 .EQ.
IF (IERRO0) THEN
2795 DELTKP=RAX*(0.5D0*XI-1.D0)
2798 44 RAX=-((M-0.5D0)*(1.D0-0.5D0/M)+A2/M)*0.5D0/X*RAX
2801 .GE.
IF (KOVER) M=2000
2804 .GT..AND..LT.
IF ((ABS(DELTAK/K)PRECI)(M1000)) GOTO 44
2808 45 RAX=-((M-0.5D0)*(1.D0-0.5D0/M)+A2/M)*0.5D0/X*RAX
2810 DELTKP=DELTAK*(XI*(0.5D0+M)-1.D0)
2812 .GE.
IF (KPOVER) M=2000
2815 .GT..AND..LT.
IF ((ABS(DELTKP/KP)PRECI)(M1000)) GOTO 45
2816 .EQ.
IF (IFAC1) THEN
2817 DF=SQRT(0.5D0/(PI*X))*EXP(X)
2823 DF=SQRT(0.5D0/(PI*X))*EXP(X-0.5D0*PIA)
2830 FDOMIN=X*(COSTH+THET*SINTH)
2831 DF=SQRT(0.5D0/(PI*X))*EXP(X-FDOMIN)
2845 SUBROUTINE AIEXLI(IFAC,X,A,DLAI,DLAID,IERROL)
2846 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2847 CCC AIRY-TYPE ASYMPTOTIC EXPANSION FOR THE K AND K' c
2850 ccc input variables:
c
2851 ccc
x: argument
of the functions
c
2852 ccc a: order
of the functions
c
2854 ccc =1, non scaled functions
c
2855 ccc otherwise, scaled functions
c
2857 ccc dlai: l
FUNCTION c
2858 ccc dlaid: derivative
of the l
FUNCTION c
2860 ccc *
IF ierrol=0, computation successful.
c
2861 ccc *
IF ierrol=1, computation out
of range.
c
2862 ccc *
IF ierrol=2, argument and/or order,
c
2864 ccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2865 ccc local variables:
2866 ccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2867 c a0ex : exact
value of the coefficient a_0
2872 c ac : coefficients a_s(psi) used
in the expansions
2874 c arg : -a**(2/3)*psi
2875 c as : accumulates the contribution
of the ac coefficients
2876 c(
for the lia(
x) function)
2877 c asp : accumulates the contribution
of the ac coefficients
2878 c(
for the lia
'(X) FUNCTION)
2879 C B0EX : EXACT VALUE OF THE COEFFICIENT B_0
2880 C B0PEX : EXACT VALUE OF THE COEFFICIENT B'_0
2881 c bc : coefficients b_s(psi) used
in the expansions
2882 c bii : imaginary
part of the airy
FUNCTION bi(Z)
2883 c bir :
REAL part of the airy function bi(
z)
2884 c bs : accumulates the contribution
of the bc coefficients
2885 c(
for the lia(
x) function)
2886 c bso : accumulates the old values
of bs
2887 c bsp : accumulates the contribution
of the bc coefficients
2888 c(
for the lia
'(X) FUNCTION)
2889 C BSPO : ACCUMULATES THE OLD VALUES OF BSP
2890 C C0EX : EXACT VALUE OF THE COEFFICIENT C_0
2891 C CHI : ACCUMULATES THE CONTRIBUTION OF THE CHIN COEFFICIENTS
2892 C CHIEX : EXACT VALUE OF THE FUNCTION CHI(PSI)
2893 C CHIN : COEFFICIENTS FOR THE EXPANSION OF THE FUNCTION
2896 C D0EX : EXACT VALUE OF THE COEFFICIENT D_0
2897 C DBII : IMAGINARY PART OF THE AIRY FUNCTION BI'(
z)
2898 c dbir :
REAL part of the airy function bi
'(Z)
2900 C DZZ : (ABS(1-Z**2))**(1/2)
2901 C ETA : PSI/2**(1/3)
2905 C EXPAM : EXP(A*PI/2-FDOMIN)
2906 C EXPAPI : EXP(A*PI/2)
2907 C F2 : (-)**K/A**(2*K)
2908 C F4 : (A**(1/3))**4
2909 C FAC : FACTOR FOR THE LIA(X) FUNCTION
2910 C FACD : FACTOR FOR THE LIA'(
x) function
2911 c fdomin :
x*(
cos(thet)+thet*sin(thet))
2914 c *
IF ifaca=1, computation
of unscaled airy bi(
z),bi
'(Z)
2915 C *IF IFACA=2, COMPUTATION OF SCALED AIRY BI(Z),BI'(
z)
2917 c *
IF ifun=1, computation
of airy bi(
z)
2918 c *
IF ifun=2, computation
of airy bi
'(Z)
2919 C OVER : OVERFLOW NUMBER
2920 C PHI : COEFFICIENTS FOR THE EXPANSION OF THE FUNCTION
2922 C PHIEX : EXACT VALUE OF THE FUNCTION PHI(PSI)
2923 C PHIEX2 : PHI(PSI)**2
2924 C PHIS : VALUE OF THE FUNCTION PHI(PSI)
2928 C *IF 0<=Z<=1, 2/3*PSI**3/2=LOG((1+SQRT(1-Z**2))/Z)-SQRT(1-Z**2)
2929 C *IF Z>=1, 2/3*(-PSI)**3/2=SQRT(Z**2-1)-ARCCOS(1/Z)
2933 C SAS : ACCUMULATES THE CONTRIBUTION OF A_S(PSI)
2934 C SBS : ACCUMULATES THE CONTRIBUTION OF B_S(PSI)
2935 C SCS : ACCUMULATES THE CONTRIBUTION OF C_S(PSI)
2936 C SDS : ACCUMULATES THE CONTRIBUTION OF D_S(PSI)
2944 C ZDS : SQRT(1-Z**2)
2945 C ZMASF : EXPANSION IN TERMS OF (Z-1) FOR THE
2946 C CALCULATION OF PSI(Z)
2947 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2948 DOUBLE PRECISION A,A0EX,A13,A2,A23,A2K,AC(0:5,0:20),
2949 + APIHAL,ARG,AS,ASP,B0EX,B0PEX,BC(0:5,0:20),BII,BIR,
2950 + BS,BSO,BSP,BSPO,C0EX,CHI,CHIEX,CHIN(0:26),COSTH,
2951 + COZMAS(0:12),D0EX,D1MACH,DBII,DBIR,DF,DLAI,DLAID
2952 DOUBLE PRECISION DZZ,ETA,ETAJ,ETAK,ETAL,EXPAM,EXPAPI,
2953 + F2,F4,FAC,FACD,FDOMIN,OVER,PHI(0:35),PHIEX,PHIEX2,
2954 + PHIS,PI,PIHALF,PSI,PSI12,PSI2,PSI3,SAS,SBS,SCS,SDS,
2955 + SIG,SINTH,THET,X,Y,Z,Z2,Z21M,ZDS,ZMASF
2956 INTEGER IERRO,IERROL,IFAC,IFACA,IFUN,INDA(0:5),INDB(0:5),
2959 CCCC VALUES OF THE COEFFICIENTS
2960 DATA PHI/1.D0,0.2D0,.25714285714285714286D-1,
2961 + -.56507936507936507937D-2,-.39367965367965367965D-2,
2962 + -.5209362066504924D-3,.3708541264731741D-3,
2963 + .2123827840293627D-3,.2150629788753145D-4,
2964 + -.2636904062981799D-4,-.1405469826493129D-4,
2965 + -.1149328899029441D-5,.1972641193938624D-5,
2966 + .1014324305593329D-5,.7034331100192200D-7,
2967 + -.1525044777392676D-6,-.7677866256900572D-7,
2968 + -.4669842638693018D-8,.1206673645965329D-7,
2969 + .5990877668092344D-8,.3269102150077715D-9,
2970 + -.97138350244428335095D-9,-.47745934295232233834D-9,
2971 + -.23750318642839155779D-10,.79244598109106655567D-10,
2972 + .38653584230817865528D-10,.17734105846426807873D-11,
2973 + -.65332110030864751956D-11,-.31673512094772575686D-11,
2974 + -.13524195177121030660D-12,.54324103217903338951D-12,
2975 + .26204918647967626464D-12,.10488134973664584898D-13,
2976 + -.45490420121539001435D-13,-.21851238232690420878D-13,
2977 + -.82456080260379042800D-15/
2978 DATA CHIN/.2D0,.1142857142857142857142857D-1,
2979 + -.2438095238095238095238095D-1,-.1003471449185734900020614D-1,
2980 + .8811404468547325690182833D-3,.2318339655809043564145605D-2,
2981 + .7794494413564441575646057D-3,-.1373952504077228744949558D-3,
2982 + -.2162301322540308393022684D-3,-.6585004634375583559042795D-4,
2983 + .1502851367097217578058824D-4,.1991904617871647675455262D-4,
2984 + .5731972706719818525615427D-5,-.1496427612747891044606885D-5,
2985 + -.1821231830428939670133992D-5,-.5054254875930882534538217D-6,
2986 + .1433283859497625931203415D-6,.1657681319078678321113361D-6,
2987 + .4485592642702540575627044D-7,-.1346138242826094098161839D-7,
2988 + -.1504601862773535117708677D-7,-.3995660198654805921651406D-8,
2989 + .1250124931952495738882300D-8,.1363187174221864073749532D-8,
2990 + .3567608459777506132029204D-9,-.1152749290139859167119863D-9,
2991 + -.1233547289799408517691696D-9/
2992 DATA COZMAS/.9428090415820634D0,-.4242640687119285D0,
2993 + .2904188565587606D0,-.2234261009999160D0,
2994 + .1821754153944745D0,-.1539625154198624D0,
2995 + .1333737583085222D0,-.1176617834148007D0,
2996 + .1052687194772381D0,-.9524025714638822D-1,
2997 + .8695738197073783D-1,-.8000034897653656D-1,
2998 + .7407421797273086D-1/
3000 DATA AC(1,0)/-.44444444444444444445D-2/
3001 DATA AC(1,1)/-.18441558441558441558D-2/
3002 DATA AC(1,2)/.11213675213675213675D-2/
3003 DATA AC(1,3)/.13457752124418791086D-2/
3004 DATA AC(1,4)/.0003880626562979504D0/
3005 DATA AC(1,5)/-.0001830686723781799D0/
3006 DATA AC(1,6)/-.0001995460887806733D0/
3007 DATA AC(1,7)/-.00005256191234041587D0/
3008 DATA AC(1,8)/.00002460619652459158D0/
3009 DATA AC(1,9)/.00002519246780924541D0/
3010 DATA AC(1,10)/.6333157376533242D-5/
3011 DATA AC(1,11)/-.2957485733830202D-5/
3012 DATA AC(1,12)/-.2925255920564838D-5/
3013 DATA AC(1,13)/-.7159702610502009D-6/
3014 DATA AC(1,14)/.3331510720390949D-6/
3015 DATA AC(1,15)/.3227670475692310D-6/
3016 DATA AC(1,16)/.7767729381664199D-7/
3017 DATA AC(1,17)/-.3600954237921120D-7/
3018 DATA AC(1,18)/-.3441724449034226D-7/
3019 DATA AC(1,19)/-.8188194356398772D-8/
3020 DATA AC(1,20)/.3783148485152038D-8/
3021 DATA AC(2,0)/.69373554135458897365D-3/
3022 DATA AC(2,1)/.46448349036584330703D-3/
3023 DATA AC(2,2)/-.42838130171535112460D-3/
3024 DATA AC(2,3)/-.0007026702868771135D0/
3025 DATA AC(2,4)/-.0002632580046778811D0/
3026 DATA AC(2,5)/.0001663853666288703D0/
3027 DATA AC(2,6)/.0002212087687818584D0/
3028 DATA AC(2,7)/.00007020345615329662D0/
3029 DATA AC(2,8)/-.00004000421782540614D0/
3030 DATA AC(2,9)/-.00004786324966453962D0/
3031 DATA AC(2,10)/-.00001394600741473631D0/
3032 DATA AC(2,11)/.7536186591273727D-5/
3033 DATA AC(2,12)/.8478502161067667D-5/
3034 DATA AC(2,13)/.2345355228453912D-5/
3035 DATA AC(2,14)/-.1225943294710883D-5/
3036 DATA AC(2,15)/-.1325082343401027D-5/
3037 DATA AC(2,16)/-.3539954776569997D-6/
3038 DATA AC(2,17)/.1808291719376674D-6/
3039 DATA AC(2,18)/.1900383515233655D-6/
3040 DATA AC(3,0)/-.35421197145774384076D-3/
3041 DATA AC(3,1)/-.31232252789031883276D-3/
3042 DATA AC(3,2)/.3716442237502298D-3/
3043 DATA AC(3,3)/.0007539269155977733D0/
3044 DATA AC(3,4)/.0003408300059444739D0/
3045 DATA AC(3,5)/-.0002634968172069594D0/
3046 DATA AC(3,6)/-.0004089275726648432D0/
3047 DATA AC(3,7)/-.0001501108759563460D0/
3048 DATA AC(3,8)/.00009964015205538056D0/
3049 DATA AC(3,9)/.0001352492955751283D0/
3050 DATA AC(3,10)/.00004443117087272903D0/
3051 DATA AC(3,11)/-.00002713205071914117D0/
3052 DATA AC(3,12)/-.00003396796969771860D0/
3053 DATA AC(3,13)/-.00001040708865273043D0/
3054 DATA AC(3,14)/.6024639065414414D-5/
3055 DATA AC(3,15)/.7143919607846883D-5/
3056 DATA AC(4,0)/.378194199201773D-3/
3057 DATA AC(4,1)/.000404943905523634D0/
3058 DATA AC(4,2)/-.000579130526946453D0/
3059 DATA AC(4,3)/-.00138017901171011D0/
3060 DATA AC(4,4)/-.000722520056780091D0/
3061 DATA AC(4,5)/.000651265924036825D0/
3062 DATA AC(4,6)/.00114674563328389D0/
3063 DATA AC(4,7)/.000474423189340405D0/
3064 DATA AC(4,8)/-.000356495172735468D0/
3065 DATA AC(4,9)/-.000538157791035111D0/
3066 DATA AC(4,10)/-.000195687390661225D0/
3067 DATA AC(4,11)/.000132563525210293D0/
3068 DATA AC(4,12)/.000181949256267291D0/
3069 DATA AC(5,0)/-.69114139728829416760D-3/
3070 DATA AC(5,1)/-.00085995326611774383285D0/
3071 DATA AC(5,2)/.0014202335568143511489D0/
3072 DATA AC(5,3)/.0038535426995603052443D0/
3073 DATA AC(5,4)/.0022752811642901374595D0/
3074 DATA AC(5,5)/-.0023219572034556988366D0/
3075 DATA AC(5,6)/-.0045478643394434635622D0/
3076 DATA AC(5,7)/-.0020824431758272449919D0/
3077 DATA AC(5,8)/.0017370443573195808719D0/
3078 DATA BC(0,0)/.14285714285714285714D-1/
3079 DATA BC(0,1)/.88888888888888888889D-2/
3080 DATA BC(0,2)/.20482374768089053803D-2/
3081 DATA BC(0,3)/-.57826617826617826618D-3/
3082 DATA BC(0,4)/-.60412089799844901886D-3/
3083 DATA BC(0,5)/-.0001472685745626922D0/
3084 DATA BC(0,6)/.00005324102148009784D0/
3085 DATA BC(0,7)/.00005206561006583416D0/
3086 DATA BC(0,8)/.00001233115050894939D0/
3087 DATA BC(0,9)/-.4905932728531366D-5/
3088 DATA BC(0,10)/-.4632230987136350D-5/
3089 DATA BC(0,11)/-.1077174523455235D-5/
3090 DATA BC(0,12)/.4475963978932822D-6/
3091 DATA BC(0,13)/.4152586188464624D-6/
3092 DATA BC(0,14)/.9555819293589234D-7/
3093 DATA BC(0,15)/-.4060599208403059D-7/
3094 DATA BC(0,16)/-.3731367187988482D-7/
3095 DATA BC(0,17)/-.8532670645553778D-8/
3096 DATA BC(0,18)/.3673017245573624D-8/
3097 DATA BC(0,19)/.3355960460784536D-8/
3098 DATA BC(0,20)/.7643107095110475D-9/
3099 DATA BC(1,0)/-.11848595848595848596D-2/
3100 DATA BC(1,1)/-.13940630797773654917D-2/
3101 DATA BC(1,2)/-.48141005586383737645D-3/
3102 DATA BC(1,3)/.26841705366016142958D-3/
3103 DATA BC(1,4)/.0003419706982709903D0/
3104 DATA BC(1,5)/.0001034548234902078D0/
3105 DATA BC(1,6)/-.00005418191982095504D0/
3106 DATA BC(1,7)/-.00006202184830690167D0/
3107 DATA BC(1,8)/-.00001724885886056087D0/
3108 DATA BC(1,9)/.8744675992887053D-5/
3109 DATA BC(1,10)/.9420684216180929D-5/
3110 DATA BC(1,11)/.2494922112085850D-5/
3111 DATA BC(1,12)/-.1238458608836357D-5/
3112 DATA BC(1,13)/-.1285461713809769D-5/
3113 DATA BC(1,14)/-.3299710862537507D-6/
3114 DATA BC(1,15)/.1613441105788315D-6/
3115 DATA BC(1,16)/.1633623194402374D-6/
3116 DATA BC(1,17)/.4104252949605779D-7/
3117 DATA BC(1,18)/-.1984317042326989D-7/
3118 DATA BC(1,19)/-.1973948142769706D-7/
3119 DATA BC(1,20)/-.4882194808588752D-8/
3120 DATA BC(2,0)/.43829180944898810994D-3/
3121 DATA BC(2,1)/.71104865116708668943D-3/
3122 DATA BC(2,2)/.31858383945387580576D-3/
3123 DATA BC(2,3)/-.0002404809426804458D0/
3124 DATA BC(2,4)/-.0003722966038621536D0/
3125 DATA BC(2,5)/-.0001352752059595618D0/
3126 DATA BC(2,6)/.00008691694372704142D0/
3127 DATA BC(2,7)/.0001158750753591377D0/
3128 DATA BC(2,8)/.00003724965927846447D0/
3129 DATA BC(2,9)/-.00002198334949606935D0/
3130 DATA BC(2,10)/-.00002686449633870452D0/
3131 DATA BC(2,11)/-.8023061612032524D-5/
3132 DATA BC(2,12)/.4494756592180126D-5/
3133 DATA BC(2,13)/.5193504763856015D-5/
3134 DATA BC(2,14)/.1477156191529617D-5/
3135 DATA BC(2,15)/-.7988793826096784D-6/
3136 DATA BC(3,0)/-.37670439477105454219D-3/
3137 DATA BC(3,1)/-.75856271658798642365D-3/
3138 DATA BC(3,2)/-.0004103253968775048D0/
3139 DATA BC(3,3)/.0003791263310429010D0/
3140 DATA BC(3,4)/.0006850981673903450D0/
3141 DATA BC(3,5)/.0002878310571932216D0/
3142 DATA BC(3,6)/-.0002157010636115705D0/
3143 DATA BC(3,7)/-.0003260863991373500D0/
3144 DATA BC(3,8)/-.0001181317008748678D0/
3145 DATA BC(3,9)/.00007887526841582582D0/
3146 DATA BC(3,10)/.0001072081833420685D0/
3147 DATA BC(3,11)/.00003544595251288735D0/
3148 DATA BC(3,12)/-.00002201447920733824D0/
3149 DATA BC(3,13)/-.00002789336359620813D0/
3150 DATA BC(4,0)/.00058453330122076187255D0/
3151 DATA BC(4,1)/.0013854690422372401251D0/
3152 DATA BC(4,2)/.00086830374184946900245D0/
3153 DATA BC(4,3)/-.00093502904801345951693D0/
3154 DATA BC(4,4)/-.0019175486005525492059D0/
3155 DATA BC(4,5)/-.00090795047113308137941D0/
3156 DATA BC(4,6)/.00077050429806392235104D0/
3157 DATA BC(4,7)/.0012953100128255983488D0/
3158 DATA BC(4,8)/.00051933869471899550762D0/
3159 DATA BC(4,9)/-.00038482631948759834653D0/
3160 DATA BC(4,10)/-.00057335393099012476502D0/
3161 DATA BC(5,0)/-.0014301070053470410656D0/
3162 DATA BC(5,1)/-.0038637811942002539408D0/
3163 DATA BC(5,2)/-.0027322816261168328245D0/
3164 DATA BC(5,3)/.0033294980346743452748D0/
3165 DATA BC(5,4)/.0075972237660887795911D0/
3166 DATA BC(5,5)/.0039816655673062060620D0/
3167 DATA BC(5,6)/-.0037510180460986006595D0/
3168 DATA INDA/0,20,18,15,12,8/
3169 DATA INDB/20,20,15,13,10,6/
3170 CCCC CONSTANTS CCCCCCCCCCCCCC
3172 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
3173 OVER=D1MACH(2)*1.D-8
3175 .EQ.
IF (IFAC1) THEN
3180 FDOMIN=X*(COSTH+THET*SINTH)
3181 .GE.
IF (FDOMINLOG(OVER)) IERROL=1
3183 .GE.
IF ((PI*A*0.5D0)LOG(OVER)) IERROL=1
3186 .EQ.
IF (IERROL0) THEN
3188 DF=2.D0**(1.D0/3.D0)
3189 CCCC VARIABLES CCCCCCCCCCCCCCC
3194 .EQ.
IF (IFAC1) THEN
3197 FAC=EXPAPI*0.5D0/A13
3207 FDOMIN=X*(COSTH+THET*SINTH)
3208 EXPAM=EXP(A*PIHALF-FDOMIN)
3214 .LE.
IF (Z0.9D0) THEN
3215 ZDS=SQRT((1.D0-Z)*(1.D0+Z))
3216 PSI=(1.5D0*(LOG((1.D0+ZDS)/Z)-ZDS))**(2.D0/3.D0)
3217 .GT.
ELSEIF (Z1.1D0) THEN
3218 ZDS=SQRT((Z-1.D0)*(1.D0+Z))
3219 PSI=-(1.5D0*(ZDS-ACOS(1.D0/Z)))**(2.D0/3.D0)
3225 ZMASF=COZMAS(J)+Y*ZMASF
3227 ZMASF=ABS(Y)**(1.5D0)*ZMASF
3228 .LT.
IF (Z1.D0) THEN
3229 PSI=(1.5D0*ZMASF)**(2.D0/3.D0)
3231 PSI=-(1.5D0*ZMASF)**(2.D0/3.D0)
3238 .GT..AND..LT.
IF ((Z0.8D0)(Z1.2D0)) THEN
3253 CHI=CHI+CHIN(L)*ETAL
3272 PHIS=PHIS+PHI(K)*ETAK
3281 .LE.
IF (JINDA(K)) THEN
3284 .LE.
IF (JINDB(K)) THEN
3287 .LE.
IF ((J+1)INDA(K)) THEN
3288 ASP=ASP+(J+1)*AC(K,J+1)*ETAJ
3290 .LE.
IF ((J+1)INDB(K)) THEN
3291 BSP=BSP+(J+1)*BC(K,J+1)*ETAJ
3298 SDS=SDS-(CHI*AS+ASP+PSI*BS)*F2
3300 .GT..AND..LE.
IF ((K0)(K6)) THEN
3301 SCS=SCS+(AS+CHI*BSO+BSPO)*F2
3307 CCCC EXACT VALUES CCCCCCCCCCCCCCCCCCCCC
3310 PHIEX=(4.D0*PSI/Z21M)**0.25D0
3313 B0EX=-5.D0/48.D0/(PSI*PSI)+PHIEX2/48.D0/PSI*
3315 CHIEX=0.25D0/PSI*(1.D0-Z2*PHIEX2**3*0.25D0)
3317 D0EX=-(7.D0/48.D0/PSI+PHIEX2/48.D0*
3319 .GT.
IF (PSI0.D0) THEN
3326 B0PEX=5.D0/24.D0/PSI3+PHIEX2/48.D0*((2.D0*CHI*PSI-1.D0)/
3327 + PSI2*(5.D0/Z21M-3.D0)-10.D0*Z2*PSI12/
3355 .LE.
IF (JINDA(K)) THEN
3358 .LE.
IF (JINDB(K)) THEN
3361 .LE.
IF ((J+1)INDA(K)) THEN
3362 ASP=ASP+(J+1)*AC(K,J+1)*ETAJ
3364 .LE.
IF ((J+1)INDB(K)) THEN
3365 BSP=BSP+(J+1)*BC(K,J+1)*ETAJ
3372 SDS=SDS-(CHI*AS+ASP+PSI*BS)*F2
3375 SCS=SCS+(AS+CHI*BSO+BSPO)*F2
3377 SCS=SCS+(AS+CHI*B0EX+B0PEX)*F2
3382 CCCCC CALL THE AIRY ROUTINE CCCCCCCCC
3385 CALL BIZ(IFUN,IFACA,ARG,0.D0,BIR,BII,IERRO)
3388 CALL BIZ(IFUN,IFACA,ARG,0.D0,DBIR,DBII,IERRO)
3389 DLAI=FAC*PHIS*(BIR*SAS+DBIR*SBS/F4)
3390 DLAID=FACD/PHIS*(DBIR*SCS+BIR*SDS/A23)
3399 DOUBLE PRECISION FUNCTION V(U)
3400 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3401 CCC AUXILIARY FUNCTION:
3402 CCC THIS FUNCTION COMPUTES THE LAST EXPRESSION
3403 CCC IN EQ.(21) OF THE REFERENCE
3404 CCC 'computing solutions
of the modified bessel
3405 ccc differential equation
for imaginary orders
3406 ccc and positive arguments
',
3407 CCC A. GIL, J. SEGURA, N.M. TEMME
3408 CCC ACM TRANS. MATH. SOFT. (2004)
3409 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3411 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3412 C U : ARGUMENT OF THE FUNCTION
3413 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3414 CCC LOCAL VARIABLES:
3415 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3417 C FDOMIN : X*(COS(THET)+THET*SIN(THET))
3419 C THET : ASIN(PNU/X)
3420 C UNDER : UNDERFLOW NUMBER
3421 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3422 DOUBLE PRECISION COSTH,D1MACH,FDOMIN,SINTH,
3424 COMMON/PARMON/THET,SINTH,COSTH,FDOMIN
3425 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
3426 UNDER=D1MACH(1)*1.D+6
3427 .LT.
IF (ABS(U)UNDER) THEN
3430 V=ASIN(U/SINH(U)*SINTH)
3435 DOUBLE PRECISION FUNCTION PHIR(U)
3436 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3437 CCC AUXILIARY FUNCTION:
3438 CCC THIS FUNCTION COMPUTES THE EXPONENT IN THE
3439 CCC INTEGRAND IN EQ.(20) OF THE REFERENCE
3440 CCC 'computing solutions
of the modified bessel
3441 ccc differential equation
for imaginary orders
3442 ccc and positive arguments
',
3443 CCC A. GIL, J. SEGURA, N.M. TEMME
3444 CCC ACM TRANS. MATH. SOFT. (2004)
3445 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3447 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3448 C U : ARGUMENT OF THE FUNCTION
3449 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3450 CCC LOCAL VARIABLES:
3451 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3454 C FDOMIN : X*(COS(THET)+THET*SIN(THET))
3455 C FU1 : 2*SINH(U/2)**2
3456 C FU2 : -2*SIN(FU3/2)*SIN(0.5*(V(U)+THET))
3457 C FU3 : ASIN(-SIN(THET)/(COS(THET)*U/SINH(U)
3458 C +COS(V(U))*(SINH(U)+U)*FUAC/(SINH(U)*SINH(U)))
3459 C FUAC : U**3/6+U**5/120+U**7/5040
3460 C OVER : OVERFLOW NUMBER
3461 C PNU : ORDER OF THE FUNCTION
3463 C SINHUH : SINH(U/2)
3465 C THET : ASIN(PNU/X)
3471 C UNDER : UNDERFLOW NUMBER
3472 C V(U) : ASIN(U/SINH(U)*SIN(THET))
3474 C X : ARGUMENT OF THE FUNCTIONS
3475 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3476 DOUBLE PRECISION COSTH,COSVU,D1MACH,FDOMIN,FU1,FU2,
3477 + FU3,FUAC,OVER,PNU,SINHU,SINHUH,SINTH,THET,U,U2,
3478 + U3,U5,U7,UH,UNDER,V,VU,X
3480 COMMON/PARMON/THET,SINTH,COSTH,FDOMIN
3481 CCC MACHINE DEPENDENT CONSTANT (UNDERFLOW NUMBER)
3482 UNDER=D1MACH(1)*1.D+6
3483 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
3484 OVER=D1MACH(2)*1.D-6
3485 .LT.
IF (U200.D0) THEN
3486 .LT.
IF (ABS(U)0.1D0) THEN
3487 .LT.
IF (ABS(U)UNDER) THEN
3492 FU1=2.D0*SINHUH*SINHUH
3497 FUAC=U3/6.D0+U5/120.D0+U7/5040.D0
3501 FU3=ASIN(-SINTH/(COSTH*U/SINHU+COSVU)*
3502 + (SINHU+U)*FUAC/(SINHU*SINHU))
3503 FU2=-2.D0*SIN(FU3*0.5D0)*SIN(0.5D0*(VU+THET))
3504 PHIR=X*(FU1*COSVU+FU2+SINTH*FU3)
3509 PHIR=X*COSH(U)*COSVU+PNU*VU-FDOMIN
3517 DOUBLE PRECISION FUNCTION SIGMA(U)
3518 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3519 CCC AUXILIARY FUNCTION:
3520 CCC THIS FUNCTION COMPUTES THE FUNCTION
3521 CCC SIGMA FROM EQ.(31) OF THE REFERENCE
3522 CCC 'computing solutions
of the modified bessel
3523 ccc differential equation
for imaginary orders
3524 ccc and positive arguments
',
3525 CCC A. GIL, J. SEGURA, N.M. TEMME
3526 CCC ACM TRANS. MATH. SOFT. (2004)
3527 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3529 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3530 C U : ARGUMENT OF THE FUNCTION
3531 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3532 CCC LOCAL VARIABLES:
3533 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3534 C ARGU : (COSH(MU)*U-DMUFAC)/SINH(U)
3537 C D1 : COSH(MU)*U-DMUFAC
3538 C DMU : SOLUTION MU OF COSH(MU)=PNU/X
3539 C DMUFAC : MU*COSH(MU)-SINH(MU)
3543 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3544 DOUBLE PRECISION ARGU,COSCHI,COSHM,D1,DMU,DMUFAC,
3545 + PI,SINCHI,SINHM,SINHU,U
3546 COMMON/PAROS1/DMU,COSHM,SINHM,DMUFAC,COSCHI,SINCHI
3551 .GT.
IF (ABS(ARGU)1.D0) THEN
3555 .LT.
IF (UDMU) SIGMA=PI-SIGMA
3559 DOUBLE PRECISION FUNCTION PHIB(U)
3560 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3561 CCC THIS FUNCTION COMPUTES THE FIRST EXPRESSION
3562 CCC OF EQ.(30) OF THE REFERENCE
3563 CCC 'computing solutions
of the modified bessel
3564 ccc differential equation
for imaginary orders
3565 ccc and positive arguments
',
3566 CCC A. GIL, J. SEGURA, N.M. TEMME
3567 CCC ACM TRANS. MATH. SOFT. (2004)
3568 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3570 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3571 C U : ARGUMENT OF THE FUNCTION
3572 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3573 CCC LOCAL VARIABLES:
3574 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3575 C OVER : OVERFLOW NUMBER
3576 C PNU : ORDER OF THE FUNCTIONS
3577 C SIGMA(U) : ASIN((COSH(MU)*U-DMUFAC)/SINH(U))
3579 C X : ARGUMENT OF THE FUNCTIONS
3580 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3581 DOUBLE PRECISION U,SIGMA,SIGMAU,OVER,D1MACH,
3584 CCC MACHINE DEPENDENT CONSTANT (OVERFLOW NUMBER)
3585 OVER=D1MACH(2)*1.D-8
3586 .LT.
IF (U200.D0) THEN
3588 PHIB=X*COSH(U)*COS(SIGMAU)+PNU*SIGMAU