      COMPLEX*16 FUNCTION CCDS(H1,H2,BETA)
C
C     THIS FUNCTION EVALUATES THE RATIOS OF COSINE AND SINE
C     FUNCTIONS WHICH APPEARS IN THE CROSS COUPLING INTEGRALS.
C     IT IS DESIGNED SPECIFICALLY FOR THE CASE WHEN (H-HB)*BETA
C     HAS A LARGE IMAGINARY PART.
C
      IMPLICIT REAL*8 (A-H,O-Z)
C      COMMON /ACCUR/ CONST1
      COMMON /BLKEVN/ HB,CW,CB,FKW,FKB,ROHW,ROHB,ATEN
C
      COMPLEX*16 BETA,CI,U,V,W,ARG1,ARG2
C
      CI=DCMPLX(0.0,1.0)
C
      ARG1=BETA*2.0*(HB-H1)
      ARG2=BETA*2.0*(HB-H2)
C
C     88.0D0 IS A MACHINE DEPENDENT CONSTANT, THE FOLLOWING LOGIC
C     ELIMINATES UNDERFLOW ERRORS.
C
      IF(DIMAG(ARG1) .GT. 88.0D0) THEN
      U=DCMPLX(1.0,0.0)
      ELSE
      U=1.0+CDEXP(CI*ARG1)
      END IF
C
      IF(DIMAG(ARG2) .GT. 88.0D0) THEN
      V=DCMPLX(1.0,0.0)
      ELSE
      V=1.0-CDEXP(CI*ARG2)
      END IF
C
      W=CDEXP(CI*BETA*(H1-H2))
      CCDS=CI*W*U/V
C
      RETURN
      END
