      COMPLEX FUNCTION CDCDOT (N, CB, CX, INCX, CY, INCY)
      INTEGER N, INCX, INCY, I, KX, KY
      COMPLEX CX(*), CY(*), CB
      DOUBLE PRECISION DSDOTR, DSDOTI, DT1, DT2, DT3, DT4
C***FIRST EXECUTABLE STATEMENT  CDCDOT
      DSDOTR = DBLE(REAL(CB))
      DSDOTI = DBLE(AIMAG(CB))
      IF (N .LE. 0) GO TO 10
      KX = 1
      KY = 1
      IF(INCX.LT.0) KX = 1+(1-N)*INCX
      IF(INCY.LT.0) KY = 1+(1-N)*INCY
      DO 5 I = 1,N
        DT1 = DBLE(REAL(CX(KX)))
        DT2 = DBLE(REAL(CY(KY)))
        DT3 = DBLE(AIMAG(CX(KX)))
        DT4 = DBLE(AIMAG(CY(KY)))
        DSDOTR = DSDOTR+(DT1*DT2)-(DT3*DT4)
        DSDOTI = DSDOTI+(DT1*DT4)+(DT3*DT2)
        KX = KX+INCX
        KY = KY+INCY
    5 CONTINUE
   10 CDCDOT = CMPLX(REAL(DSDOTR),REAL(DSDOTI))
      RETURN
      END
