Function rgsl::types::rng::unix::rand48

source ·
pub fn rand48() -> RngType
Expand description

This is the Unix rand48 generator. Its sequence is

x_{n+1} = (a x_n + c) mod m defined on 48-bit unsigned integers with a = 25214903917, c = 11 and m = 2^48. The seed specifies the upper 32 bits of the initial value, x_1, with the lower 16 bits set to 0x330E. The function gsl_rng_get returns the upper 32 bits from each term of the sequence. This does not have a direct parallel in the original rand48 functions, but forcing the result to type long int reproduces the output of mrand48. The function gsl_rng_uniform uses the full 48 bits of internal state to return the double precision number x_n/m, which is equivalent to the function drand48. Note that some versions of the GNU C Library contained a bug in mrand48 function which caused it to produce different results (only the lower 16-bits of the return value were set).