  We provide an algorithm for generation of momenta (or energies) of
relativistic particles according to the relativistic Bose-Einstein or
Fermi-Dirac distributions. The algorithm uses rejection method with effectively
selected comparison function so that the acceptance rate of the generated
values is always better than 0.9. It might find its use in Monte-Carlo
generators of particles from reactions in high-energy physics.
