      REAL FUNCTION QWGTS (X, A, B, ALFA, BETA, INTEGR)
C
      REAL A,ALFA,B,BETA,BMX,X,XMA
      INTEGER INTEGR
C***FIRST EXECUTABLE STATEMENT  QWGTS
      XMA = X-A
      BMX = B-X
      QWGTS = XMA**ALFA*BMX**BETA
      GO TO (40,10,20,30),INTEGR
   10 QWGTS = QWGTS*LOG(XMA)
      GO TO 40
   20 QWGTS = QWGTS*LOG(BMX)
      GO TO 40
   30 QWGTS = QWGTS*LOG(XMA)*LOG(BMX)
   40 RETURN
      END
