33 function bessi(n,z,ierr)
39 double precision bessi,z
41 double precision bessi0,bessi1
42 external bessi0,bessi1
45 double precision BIGNO,BIGNI,ONE
46 parameter(iacc=40,bigno=1.0d10,bigni=1.0d-10,one=1.0d0)
49 double precision x,phase,twobyx,bi,bip,bim
68 if ((z.lt.0.0d0).and.(mod(m,2).eq.1))
then
93 bessi=phase*bessi0(x,ierr)
96 bessi=phase*bessi1(x,ierr)
103 mmax=2*((m+int(sqrt(dble(iacc*m)))))
105 bim=bip+dble(i)*twobyx*bi
108 if (abs(bi).gt.bigno)
then
113 if (i.eq.m) bessi=bip
115 bessi=phase*bessi*bessi0(x,ierr)/bi
116 if (ierr.ne.0)
return
144 double precision function bessi0(z,ierr)
154 double precision x,y,smax,temp1,temp2,temp3,sum
159 double precision tser
162 double precision CUTOFF,ONE
163 parameter(cutoff=20.0d0,one=1.0d0)
178 else if (y.le.cutoff)
then
183 10 temp1=(temp1/dble(i))*(x/dble(i))
190 if (temp1.gt.smax) smax=temp1
191 if (temp1/smax.gt.
rndoff)
go to 10
209 temp2=(x*temp1)*(temp1/dble(i))
210 if (temp2.gt.one)
go to 40
212 if (temp3.gt.smax) smax=temp3
213 if (temp3/smax.lt.
rndoff)
go to 40
217 40
bessi0=dexp(y)*((sum+one)/dsqrt(y*(
pi+
pi)))
245 double precision function bessi1(z,ierr)
255 double precision x,y,smax,temp1,temp2,temp3,phase,sum
260 double precision series
261 dimension series(nmax)
263 double precision CUTOFF,ONE
264 parameter(cutoff=20.0d0,one=1.0d0)
285 else if (y.le.cutoff)
then
290 10 temp1=(temp1/dble(i))*(x/dble(i+1))
297 if (temp1.gt.smax) smax=temp1
298 if (temp1/smax.gt.
rndoff)
go to 10
315 temp1=temp1*temp1-4.0d0
316 temp2=(x*temp1)/dble(i)
317 if (temp2.gt.one)
go to 40
319 if (temp3.gt.smax) smax=temp3
320 if (temp3/smax.lt.
rndoff)
go to 40
double precision function bessi0(z, ierr)
double precision, parameter pi
double precision function bessi1(z, ierr)
double precision, parameter rndoff
double precision function bessi(n, z, ierr)