      SUBROUTINE COSQI (N,WSAVE)
      IMPLICIT DOUBLE PRECISION (A-H, O-Z)
      DIMENSION       WSAVE(1)
      DATA PIH /1.57079632679489662d0/
      DT = PIH/DFLOAT(N)
      FK = 0.d0
      DO 101 K=1,N
         FK = FK+1.d0
         WSAVE(K) = DCOS(FK*DT)
  101 CONTINUE
      CALL RFFTI (N,WSAVE(N+1))
      RETURN
      END
