Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50145/gauss.ssp
There are 2 other files named gauss.ssp in the archive. Click here to see a list.
C GAUS 10
C ..................................................................GAUS 20
C GAUS 30
C SUBROUTINE GAUSS GAUS 40
C GAUS 50
C PURPOSE GAUS 60
C COMPUTES A NORMALLY DISTRIBUTED RANDOM NUMBER WITH A GIVEN GAUS 70
C MEAN AND STANDARD DEVIATION GAUS 80
C GAUS 90
C USAGE GAUS 100
C CALL GAUSS(IX,S,AM,V) GAUS 110
C GAUS 120
C DESCRIPTION OF PARAMETERS GAUS 130
C IX -IX MUST CONTAIN AN ODD INTEGER NUMBER WITH NINE OR GAUS 140
C LESS DIGITS ON THE FIRST ENTRY TO GAUSS. THEREAFTER GAUS 150
C IT WILL CONTAIN A UNIFORMLY DISTRIBUTED INTEGER RANDOM GAUS 160
C NUMBER GENERATED BY THE SUBROUTINE FOR USE ON THE NEXT GAUS 170
C ENTRY TO THE SUBROUTINE. GAUS 180
C S -THE DESIRED STANDARD DEVIATION OF THE NORMAL GAUS 190
C DISTRIBUTION. GAUS 200
C AM -THE DESIRED MEAN OF THE NORMAL DISTRIBUTION GAUS 210
C V -THE VALUE OF THE COMPUTED NORMAL RANDOM VARIABLE GAUS 220
C GAUS 230
C REMARKS GAUS 240
C THIS SUBROUTINE USES RANDU WHICH IS MACHINE SPECIFIC GAUS 250
C GAUS 260
C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED GAUS 270
C RANDU GAUS 280
C GAUS 290
C METHOD GAUS 300
C USES 12 UNIFORM RANDOM NUMBERS TO COMPUTE NORMAL RANDOM GAUS 310
C NUMBERS BY CENTRAL LIMIT THEOREM. THE RESULT IS THEN GAUS 320
C ADJUSTED TO MATCH THE GIVEN MEAN AND STANDARD DEVIATION. GAUS 330
C THE UNIFORM RANDOM NUMBERS COMPUTED WITHIN THE SUBROUTINE GAUS 340
C ARE FOUND BY THE POWER RESIDUE METHOD. GAUS 350
C GAUS 360
C ..................................................................GAUS 370
C GAUS 380
SUBROUTINE GAUSS(IX,S,AM,V) GAUS 390
A=0.0 GAUS 400
DO 50 I=1,12 GAUS 410
CALL RANDU(IX,IY,Y) GAUS 420
IX=IY GAUS 430
50 A=A+Y GAUS 440
V=(A-6.0)*S+AM GAUS 450
RETURN GAUS 460
END GAUS 470