sampling from $\frac{1}{1+x}$ times Gamma distribution density I am simulating a process by drawing many random variates $X$ from a Gamma distribution with parameters $\alpha$, $\beta$, $$f_X(x) = \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)} \;.$$ The simulation could be made much more efficient if samples $X$ were drawn from a modified distribution with p.d.f. $$f_X(x) \propto \frac{1}{1+x} \, \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)}$$ instead. The parameter $\beta$ is generally very small so rejection sampling the $\frac{1}{1+x}$ factor results in vanishing efficiency. Is there a clever or efficient method for generating the modified samples?
 A: Since
$$\frac{1}{1+x} \, \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)}\le \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{x\Gamma(\alpha)}=\frac{\beta}{\alpha}\frac{\beta^{\alpha-1} \, x^{\alpha-2} \, e^{-\beta x}}{\Gamma(\alpha-1)}$$
another possibility is to accept/reject with a Gamma $\mathcal G(\alpha-1,\beta)$ proposal, assuming $\alpha>1$. Since the acceptance is driven by the ratio $x/(1+x)$, the efficiency would be much improved, compared with
$$\frac{1}{1+x} \, \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)}\le \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)}$$
driven by the ratio $1/(1+x)$.
For illustration purposes, here is one evaluation of the algorithm:
  e=function(a,b,T=1e5){
  for(i in 1:T)
   while(runif(1)>1/(1+1/rgamma(1,a,b)))F=F+1
  1+F/T}

demonstrating a high acceptance rate for small values of b:
> e(4,.02)
[1] 1.00672
> e(3,.02)
[1] 1.00996
> e(2,.02)
[1] 1.01849
> e(1,.02)
[1] 1.07424
> e(.1,.02)
[1] 3.49856
> e(.1,.001)
[1] 2.14866
> e(.001,.0001)
[1] 116.4172

Note: A much faster check is obtained by computing directly the probability:
f=function(a,b,T=1e6)1/mean(runif(T)<1/(1+1/rgamma(T,a,b)))

