Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-02 - 43,50145/randu.doc
There are 2 other files named randu.doc in the archive. Click here to see a list.
SUBROUTINE RANDU

PURPOSE
   COMPUTES UNIFORMLY DISTRIBUTED RANDOM REAL NUMBERS BETWEEN
   0 AND 1.0 AND RANDOM INTEGERS BETWEEN ZERO AND
   2**31. EACH ENTRY USES AS INPUT AN INTEGER RANDOM NUMBER
   AND PRODUCES A NEW INTEGER AND REAL RANDOM NUMBER.

USAGE
   CALL RANDU(IX,IY,YFL)

DESCRIPTION OF PARAMETERS
   IX - FOR THE FIRST ENTRY THIS MUST CONTAIN ANY ODD INTEGER
	NUMBER WITH NINE OR LESS DIGITS. AFTER THE FIRST ENTRY,
	IX SHOULD BE THE PREVIOUS VALUE OF IY COMPUTED BY THIS
	SUBROUTINE.
   IY - A RESULTANT INTEGER RANDOM NUMBER REQUIRED FOR THE NEXT
	ENTRY TO THIS SUBROUTINE. THE RANGE OF THIS NUMBER IS
	BETWEEN ZERO AND 2**31
   YFL- THE RESULTANT UNIFORMLY DISTRIBUTED, FLOATING POINT,
	RANDOM NUMBER IN THE RANGE 0 TO 1.0

REMARKS
   THIS SUBROUTINE IS SPECIFIC TO SYSTEM/360 AND WILL PRODUCE
   2**29 TERMS BEFORE REPEATING.  THE REFERENCE BELOW DISCUSSES
   SEEDS (65539 HERE), RUN PROBLEMS, AND PROBLEMS CONCERNING
   RANDOM DIGITS USING THIS GENERATION SCHEME.	MACLAREN AND
   MARSAGLIA, JACM 12, P. 83-89, DISCUSS CONGRUENTIAL
   GENERATION METHODS AND TESTS.  THE USE OF TWO GENERATORS OF
   THE RANDU TYPE, ONE FILLING A TABLE AND ONE PICKING FROM THE
   TABLE, IS OF BENEFIT IN SOME CASES.	65549 HAS BEEN
   SUGGESTED AS A SEED WHICH HAS BETTER STATISTICAL PROPERTIES
   FOR HIGH ORDER BITS OF THE GENERATED DEVIATE.
   SEEDS SHOULD BE CHOSEN IN ACCORDANCE WITH THE DISCUSSION
   GIVEN IN THE REFERENCE BELOW.  ALSO, IT SHOULD BE NOTED THAT
   IF FLOATING POINT RANDOM NUMBERS ARE DESIRED,AS ARE
   AVAILABLE FROM RANDU, THE RANDOM CHARACTERISTICS OF THE
   FLOATING POINT DEVIATES ARE MODIFIED AND IN FACT THESE
   DEVIATES HAVE HIGH PROBABILITY OF HAVING A TRAILING LOW
   ORDER ZERO BIT IN THEIR FRACTIONAL PART.

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   NONE

METHOD
   POWER RESIDUE METHOD DISCUSSED IN IBM MANUAL C20-8011,
   RANDOM NUMBER GENERATION AND TESTING