	external f
	parameter(limit=10,lenw=4*limit)
	dimension iwork(limit),work(lenw)
	a=-20; b=20;
	epsabs=0.0001; epsrel=0.0001
	key=3
	call qag(f,a,b,epsabs,epsrel,key,result,abserr,neval,ier, &
&         limit,lenw,last,iwork,work)
	print *,'=============================================='
	print *,'results from qag:'
	print *,'result=',result
	print *,'abserr=',abserr
	print *,'neval=',neval
	print *,'=============================================='

	result=adapt12(f,a,b,epsrel,ncalls,err)
	print *,'results from adapt12:'
	print *,'result=',result
	print *,'abserr=',err
	print *,'ncalls=',ncalls
	print *,'=============================================='
	end

	function f(x)
	f=1/(1+x**2)
!	f=alog(x)/sqrt(x)
	end
