Abstract
In many algorithms for sampling from non-uniform distributions the logarithm of a uniform deviate must be compared with some test quantity. It is shown that all these comparisons can be done efficiently without calling a logarithm subprogram: two procedures for this task are presented and compared.
Zusammenfassung
Bei der Erzeugung nicht-gleichverteilter Zufallszahlen muß häufig der Logarithmus einer gleichverteilten Zufallszahl mit einer Testgröße verglichen werden. Es wird gezeigt, daß dieser Vergleich ohne den Aufruf einer Logarithmusroutine effizient durchführbar ist; zwei Prozeduren für diese Aufgabe werden vorgestellt und verglichen.
References
Devroye, L.: Non-Uniform Random Variate Generation. New York: Springer-Verlag 1986.
Kinderman, A. J., Monahan, J. F.: Computer generation of random variables using the ratio of uniform deviates. ACM Trans. Math. Software3, 257–260 (1977).
Knuth, D. E.: The Art of Computer Programming, Vol. I: Fundamental Algorithms. 2nd Ed. Reading, Mass.: Addison-Wesley 1973.
Knuth, D. E.: The Art of Computer Programming, Vol. II: Seminumerical Algorithms. 2nd Ed. Reading, Mass.: Addison-Wesley 1981.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Ahrens, J.H. How to avoid logarithms in comparisons with uniform random variables. Computing 41, 163–166 (1989). https://doi.org/10.1007/BF02238740
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02238740