Page 1 of 1

Random Number Generator: Uniform Distribution

PostPosted: Fri May 19, 2006 1:07 pm
by DavidB

I am seeking a random number generator (real numbers).
The distribution should be uniform over whatever interval I might specify (for example, over the interval 3 - 9, 100 - 200, etc.).

I did a search on the NETLIB site for random numbers and about 200 results showed up, with many of them having identical descriptions, so I'm not sure which one I am best off using.

Recommendations are welcome.

PostPosted: Mon May 22, 2006 1:57 pm
by Julien Langou
LAPACK provides some random number generators.
In praticular, you can use:
to get vectors with elements with uniform or normal distribution.
See for example:

PostPosted: Wed May 24, 2006 12:54 pm
by DavidB
Thanks, Julien.

I took a look at DLARNV and did not see mention of a period. Would you know the periods of these functions (i.e. - how many numbers can they generate before they start repeating)? I have come across a Mersenne Twister Pseudo-random Number Generator (, which claims to have a period of a period of 2^19937 - 1, and the Boost Random Number Library (, and I am trying to get an idea how they compare.



PostPosted: Wed May 24, 2006 5:55 pm
by Julien Langou
Sorry, I have no idea. I'd say at most 2^48 since we are using modulus 2^48 (see DLARUV) but I am not even sure about that. If you get the answer, let me know.