      IMPLICIT REAL*8 (A-H,O-Z)
      PARAMETER (MAXGUIDE=7,MAXPTS=65)
	COMMON /GUIDE/ GCON(MAXGUIDE),NGUIDE
      COMMON /PTS/ SPTS(MAXPTS),SVAL(MAXPTS),SINT(MAXPTS),SDER(MAXPTS)
      COMMON /MISC/ PI
      DIMENSION X(3,2)
	DATA NMC/1048576/
      PI=ACOS(-1D0)
	NUP=2
	NGUIDE=1
	GCON(1)=-1
	CALL RSEED(123,451)
      CALL SETUP(NGUIDE,GCON)
	SUM=0
	SUM2=0
	DO IMC=1,NMC
	  CALL XNFIND(X,WXT,NUP)
	  R12=0
	  R1MR22=0
	  R22=0
	  DO I=1,3
	    R12=R12+X(I,1)*X(I,1)
	    R22=R22+X(I,2)*X(I,2)
	    R1MR22=R1MR22+(X(I,1)-X(I,2))**2
	  ENDDO
	  F=EXP(-R12-R22)
	  FSW=F/WXT
	  SUM=SUM+FSW
	  SUM2=SUM2+FSW*FSW
	ENDDO
	SUM2=SUM2/NMC
	SUM=SUM/NMC
	ERR2=(SUM2-SUM*SUM)/NMC
	PRINT*,' INTEGRAL IS ',SUM,' +- ',SQRT(ERR2)
	STOP 
	END
C$INCLUDE RANDOM.FOR
C$INCLUDE SETUP.FOR
C$INCLUDE XNFIND