next up previous index
Next: V120 Gaussian-distributed Random Up: CERNLIB Previous: V115 Uniform Random

V116 Double Precision Uniform Random Numbers

Routine ID: V116
Author(s): F. JamesLibrary: MATHLIB
Submitter: Submitted: 15.03.1994
Language: FortranRevised:

RM48 generates pseudorandom numbers using a double-precision (64-bit) adaptation of RANMAR (V113). The floating-point numbers in the interval (0,1), the end points excluded, have 48 significant bits of mantissa (additional bits of mantissa, if supported by the hardware, are zero). Both the code and the results are portable, provided the floating-point mode is adapted to the computer being used (for example, single-precision mode on 64-bit machines, double-precision mode on 32-bit machines).

Structure:

SUBROUTINE Subprograms
User Entry Names: RM48, RM48IN, RM48UT

Usage:

    CALL RM48(RVEC,LEN)
returns a vector RVEC of LEN 64-bit random floating-point numbers in (0,1), the end points excluded. RVEC is an array of length LEN at least. It is of type DOUBLE PRECISION on 32-bit machines, and of type REAL otherwise.
    CALL RM48IN(I1,N1,N2)
initializes the generator from one 32-bit integer I1, and number counts N1, N2 (for initializing, set N1=N2=0 , but to restart a previously generated sequence, use values output by RM48UT).
    CALL RM48UT(I1,N1,N2)
outputs the value of the original seed and the two number counts, to be used for restarting by initializing to I1 and skipping 100000000*N2+N1 numbers.

Method:

The method is that of RANMAR (V113).

V120


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995