perm filename JHOI.F4[NET,GUE] blob sn#026504 filedate 1973-02-23 generic text, type T, neo UTF8
      FUNCTION JHOI(N,X)
      IMPLICIT REAL (J)
      INTEGER N,N1
      REAL X,T1
      IF(IABS(N)-2*INT(FLOAT(IABS(N))/2.+.1).NE.1) STOP
      T1=SQRT(2./(3.14159*X))
      JH=T1*SIN(X)
      JMH=T1*COS(X)
      IF (N.LT.0) GOTO 20
10    JAM2=JMH
      JAM1=JH
      JHOI=JH
      IF (N.EQ.1) RETURN
      DO 100 I=3,N,2
      JHOI=(FLOAT(I)-2.)*JAM1/X-JAM2
      JAM2=JAM1
100   JAM1=JHOI
      RETURN
20    JAP2=JH
      JAP1=JMH
      JHOI=JMH
      IF (N.EQ.-1) RETURN
      N1=-N
      DO 200 I=3,N1,2
      JHOI=(FLOAT(-I)+2.)*JAP1/X-JAP2
      JAP2=JAP1
200   JAP1=JHOI
      RETURN
      END