Unbias a random generator: Difference between revisions

m
Line 831:
 
=={{header|PARI/GP}}==
GP's random number generation is high-quality, using Brent's [http://maths.anu.edu.au/~brent/random.html XORGEN]. Thus this program is slow: the required 400,000 unbiased numbers (generated through this bias/unbias scheme take nearly a second. This requires about two million calls to <code>random</code>), generatedwhich in turn generate a total of about three million calls to the underlying random number generator through thisthe bias/unbiasrejection strategy. The overall efficiency of the scheme takeis nearly0.8% afor second32-bit and 0.4% for 64-bit...
<lang parigp>randN(N)=!random(N);
unbiased(N)={