      subroutine rmapow(xr,ai) ! bernd berg oct 23 2006.
c generates independent random numbers xr with power law probability 
c density (a/two)/(one+|x|)**(one+a). routine argument: ai=one/a.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      parameter(eps=one/two**25)
      yr=rmafun()+eps ! zero<yr<one. eps smallest value.
      if(yr.le.half) then
        xr=one-(half/yr)**ai
      else
        xr=(half/(one-yr))**ai-one
      endif
c     write(6,'(2f10.6)') yr,xr
      return
      end 
