Source: http://vivienfrederic.free.fr/simulation_rand_calc.pdf