function ranf(xl,xh,ymax,m,M0) real*8 ranf,xl,xh,ymax real*8 x,y,test,m(3),M0 real*4 ran_true 100 call ranlux(ran_true,1) x=(xh-xl)*dble(ran_true)+xl call ranlux(ran_true,1) y=ymax*dble(ran_true) test=dsqrt((x**2-(m(1)+m(2))**2)*(x**2-(m(1)-m(2))**2))/2.d0/x > *dsqrt((M0**2-(x+m(3))**2)*(M0**2-(x-m(3))**2)) > /2.d0/M0 if(test.lt.0.)goto 100 if(y.gt.test)goto 100 ranf=x return end