github.com/gopherd/gonum@v0.0.4/mathext/internal/amos/amoslib/zbunk.f (about) 1 SUBROUTINE ZBUNK(ZR, ZI, FNU, KODE, MR, N, YR, YI, NZ, TOL, ELIM, 2 * ALIM) 3 C***BEGIN PROLOGUE ZBUNK 4 C***REFER TO ZBESK,ZBESH 5 C 6 C ZBUNK COMPUTES THE K BESSEL FUNCTION FOR FNU.GT.FNUL. 7 C ACCORDING TO THE UNIFORM ASYMPTOTIC EXPANSION FOR K(FNU,Z) 8 C IN ZUNK1 AND THE EXPANSION FOR H(2,FNU,Z) IN ZUNK2 9 C 10 C***ROUTINES CALLED ZUNK1,ZUNK2 11 C***END PROLOGUE ZBUNK 12 C COMPLEX Y,Z 13 DOUBLE PRECISION ALIM, AX, AY, ELIM, FNU, TOL, YI, YR, ZI, ZR 14 INTEGER KODE, MR, N, NZ 15 DIMENSION YR(N), YI(N) 16 NZ = 0 17 AX = DABS(ZR)*1.7321D0 18 AY = DABS(ZI) 19 IF (AY.GT.AX) GO TO 10 20 C----------------------------------------------------------------------- 21 C ASYMPTOTIC EXPANSION FOR K(FNU,Z) FOR LARGE FNU APPLIED IN 22 C -PI/3.LE.ARG(Z).LE.PI/3 23 C----------------------------------------------------------------------- 24 CALL ZUNK1(ZR, ZI, FNU, KODE, MR, N, YR, YI, NZ, TOL, ELIM, ALIM) 25 GO TO 20 26 10 CONTINUE 27 C----------------------------------------------------------------------- 28 C ASYMPTOTIC EXPANSION FOR H(2,FNU,Z*EXP(M*HPI)) FOR LARGE FNU 29 C APPLIED IN PI/3.LT.ABS(ARG(Z)).LE.PI/2 WHERE M=+I OR -I 30 C AND HPI=PI/2 31 C----------------------------------------------------------------------- 32 CALL ZUNK2(ZR, ZI, FNU, KODE, MR, N, YR, YI, NZ, TOL, ELIM, ALIM) 33 20 CONTINUE 34 RETURN 35 END