next up previous index
Next: G901 Random Points Up: CERNLIB Previous: G116 Vavilov Density

G900 Random Number Generator

Routine ID: G900
Author(s): CDCLibrary: KERNLIB or Fortran intrinsic
Submitter: H. Lipps (not CDC or Cray)Submitted: 02.06.1980
Language: Fortran or AssemblerRevised: 24.06.1985

OBSOLETE

Please note that this routine has been obsoleted in CNL 215. Users are advised not to use it any longer and to replace it in older programs. No maintenance for it will take place and it will eventually disappear.
Suggested replacement:
RANMAR (V113) or RANECU (V114) or RANLUX (V115)

Function subprograms RANF and DRANF return pseudo-random values uniformly distributed in the interval (0,1), the end points excluded. The multiplicative congruential method is used.

Subroutine subprogram RANGET makes the current seed value of RANF and DRANF available to the user, and subroutine RANSET restores a seed value for further use by RANF and DRANF.

On CDC computers, the subprograms other than DRANF are part of Control Data's Fortran execution-time library.

The non-CDC versions of RANF and DRANF use the same multiplier ( 2875 A2E7 B175), the same initial seed value ( 2BC6 8CFE 166D), and the same modulus ( 2**48). They thus generate, within the limitations of machine accuracy, the same random sequence as the CDC versions.

DRANF is identical to RANF except that it returns a function value of type DOUBLE PRECISION.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names: RANF, DRANF, RANGET, RANSET

Usage:

In any arithmetic expression, RANF() or DRANF()

is set to a value greater than zero and less than one. RANF is of type REAL, DRANF is of type DOUBLE PRECISION.

    CALL RANGET(SEED)
    CALL RANSET(SEED)
SEED
( REAL for CDC, DOUBLE PRECISION otherwise). On exit from RANGET, SEED will be set to a value that determines the current position in the sequence of random numbers. This value may be used later as an actual argument in a call to RANSET in order to restart the random sequence at this point.

References:

  1. Fortran Version 5 Reference Manual (Control Data Corporation, 1981).

G901



next up previous index
Next: G901 Random Points Up: CERNLIB Previous: G116 Vavilov Density


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