Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
115 lines (86 sloc) 3.17 KB

fast-rng: Fast random number generator for various distributions


Getting started

Resolving artifacts using Maven



Resolving artifacts using Gradle

repositories {
    maven {
        url  "" 

dependencies {
    compile group: 'biz.k11i', name: 'fast-rng', version: '0.1.5'

Generating random values

package biz.k11i.rng.demo;

import java.util.Random;

public class FastRngDemo {
    public static void main(String[] args) {
        // Fast-rng requires a java.util.Random instance to generate
        // uniformly distributed random values.
        Random random = new Random();

                // Generate a gaussian random value.

Supported distributions


This software is licensed under the terms of the MIT license. See LICENSE.



This product includes software developed at The Apache Software Foundation (


This product includes software developed by Jeff Hain.


  • Tesuaki Yotsuji. 計算機シミュレーションのための確率分布乱数生成法. Pleiades Publishing Co.,Ltd. (2010)
  • Marsaglia, George, and Wai Wan Tsang. The ziggurat method for generating random variables. Journal of statistical software 5.8 (2000): 1-7.
  • Ahrens, Joachim H., and Ulrich Dieter. Computer methods for sampling from gamma, beta, poisson and bionomial distributions. Computing 12.3 (1974): 223-246.
  • Marsaglia, George, and Wai Wan Tsang. A simple method for generating gamma variables. ACM Transactions on Mathematical Software (TOMS) 26.3 (2000): 363-372.
  • Best, D. J. A note on gamma variate generators with shape parameter less than unity. Computing 30.2 (1983): 185-188.
  • Wilson, Edwin B., and Margaret M. Hilferty. The distribution of chi-square. Proceedings of the National Academy of Sciences 17.12 (1931): 684-688.
  • Jöhnk, M. D. Erzeugung von betaverteilten und gammaverteilten Zufallszahlen. Metrika 8.1 (1964): 5-15.
  • Sakasegawa, H. Stratified rejection and squeeze method for generating beta random numbers. Annals of the Institute of Statistical Mathematics 35.1 (1983): 291-302.