      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),RA(3),RB(3)
	DATA RA/0D0,0D0,-.7D0/
	DATA RB/0D0,0D0,.7D0/ 			
	DATA NMC/16772216/
c	DATA NMC/4194304/
C	DATA NMC/1048576/
C	DATA NMC/262144/
C	DATA NMC/65536/
C	DATA NMC/16384/
      PI=ACOS(-1D0)
	NUP=2
	NGUIDE=1
	GCON(1)=-.5D0
	beta=-.123D0
	alpha=1.7D0
	ANAL=AMOLN(ALPHA,BETA,RA,RB)
	CALL RSEED(12345,451173)
      CALL SETUP(NGUIDE,GCON)
	SUM=0
	SUM2=0
	NBIG=0
	DO IMC=1,NMC
C PICK FIRST ELECTRON BIASED AS RANDOM
	  CALL XNFIND(X,WXT,1,RA,RB)
	  DO I=2,NUP
C PICK ELECTRON 2 WITH RESPECT TO NUCLEUS AND ELECTRONS
	    CALL XNEFIN(X,WNXT,I-1,I,RA,RB)
	    wxt=wxt*wnxt
	  ENDDO
	  SR1A2=0
	  SR2B2=0
	  SR12=0
	  DO J=1,3
	    SR1A2=SR1A2+(X(J,1)-RA(J))**2
	    SR2B2=SR2B2+(X(J,2)-RB(J))**2
	    SR12=SR12+(X(J,1)-X(J,2))**2
	  ENDDO
	  EXARG=-ALPHA*(SR1A2+SR2B2)-BETA*SR12
	  F=EXP(EXARG)  
	  FSW=F/WXT-ANAL
	IF(FSW.GT.10000D0)THEN
	  PRINT*,' BIG ONE FSW=',FSW
	  PRINT*,' SR1A2,SR2B2,SR12 '
	  PRINT*,SR1A2,SR2B2,SR12
	ENDIF

	  SUM=SUM+FSW
	  SUM2=SUM2+FSW*FSW
	ENDDO
	SUM2=SUM2/NMC
	SUM=SUM/NMC
	ERR=SQRT((SUM2-SUM*SUM)/NMC)
	SUM=SUM+ANAL
	PRINT*,' NMC=',NMC
	PRINT*,' THE NUMBER OF ELECTRONS IS',NUP
	PRINT*,' INTEGRAL IS ',SUM,' +- ',ERR
	PRINT*,'AINTEGRAL IS ',ANAL,' RES=',(SUM-ANAL)/ERR
	STOP 
	END
C$INCLUDE RANDOM.FOR
C$INCLUDE SETUP.FOR
C$INCLUDE XNFIND
C$INCLUDE HFUNS
C$INCLUDE XNEFIN