next up previous index
Next: V102 Pair of Up: CERNLIB Previous: V100 Random Numbers

V101 Fast Random Numbers in Normal Distribution

Routine ID: V101
Author(s): See MethodLibrary: MATHLIB
Submitter: T. LindelöfSubmitted: 15.06.1976
Language: Assembler or Fortran (Cray)Revised: 13.07.1988

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: RNORML or RNORMX (V120)

NORRAN generates a pseudo random number with normal (Gaussian) distribution, zero mean and unit variance. NORRAN is much faster than RANNOR (V100).

Structure:

SUBROUTINE subprogram
User Entry Names: NORRAN, NORRIN, NORRUT
Internal Entry Names: UNI, VNI (IBM only)

Usage:

    CALL NORRAN(RANDOM)
returns RANDOM (type REAL) as a pseudo random number in Gaussian distribution with zero mean and unit variance. The value returned in any particular call to NORRAN is statistically independent of earlier values. The sequence of values returned in subsequent calls is, however, functionally dependent on a 'seed' (two 'seeds' on 32 bits machines) which the user can extract or set as follows:
    CALL NORRUT(SEED1,SEED2)
SEED1 and SEED2 (on CDC and Cray SEED1 only) (type REAL) will be replaced by the current values (value) of the internal 'seeds' ('seed') in NORRAN.
    CALL NORRIN(SEED1,SEED2)
SEED1 and SEED2 (on CDC and Cray SEED1 only) (type REAL) replaces the current values (value) of the internal 'seeds' ('seed') in NORRAN.

Method:

CDC: See Ref. 1. IBM: See Ref. 2.

Notes:

NORRUT and NORRIN are called with two arguments, the second of which is unused (dummy) in the CDC and Cray versions of NORRAN. NORRIN should only be called with arguments set by a previous call to NORRUT. While NORRAN may function from arbitrary seed(s) its random behaviour may be unpredictable unless this restriction is observed.

References:

  1. J.H. Ahrens, Math. Comp. 27 (1973) 927
  2. G. Marsaglia, K. Ananthanarayanan and N. Paul, Comm. ACM 15 (1972) 873.

V102



next up previous index
Next: V102 Pair of Up: CERNLIB Previous: V100 Random Numbers


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