c        1         2         3         4         5         6         7
c23456789012345678901234567890123456789012345678901234567890123456789012
c        1         2         3         4         5         6         7

c----------------------------------------------------------------------
c TESTRNTGRL tests rntgrl
	
	implicit real*8(a-h,o-z)
	parameter(m=1000000)
	dimension f(0:m)
	pi=4d0*datan(1d0)

	write(6,*) 'TESTING RNTGRL'
	write(6,*) ' k=power of exp(-x) in integral from 0 to infty'
	write(6,*) ' n=no of points'
	write(6,*) ' ans=int 4*pi*r*r* exp(-k*r)*(k^3/8*pi)-1'
	do k=1,5
	xk=dreal(k)
	r0=1d0
	do n=20,80,20
	  do i=1,n
	    y=dreal(i)/dreal(n)
	    r=r0*(1d0/y-1d0)
	    f(i)=r*r*exp(-xk*r)*(k**3)/(2d0)
c	    write(60,"(10f24.16)") r,y,f(i)
	  enddo
	  ans=rntgrl(n,r0,f)-1d0
	  write(6,*) 'k=',k,' n=',n,' ans=',ans
	enddo
	write (6,*) ''
	enddo
	end




