      REAL FUNCTION QWGTF (X, OMEGA, P2, P3, P4, INTEGR)
C
      REAL OMEGA,OMX,P2,P3,P4,X
      INTEGER INTEGR
C***FIRST EXECUTABLE STATEMENT  QWGTF
      OMX = OMEGA*X
      GO TO(10,20),INTEGR
   10 QWGTF = COS(OMX)
      GO TO 30
   20 QWGTF = SIN(OMX)
   30 RETURN
      END
