2329
|
1 REAL FUNCTION genexp(av) |
|
2 C********************************************************************** |
|
3 C |
|
4 C REAL FUNCTION GENEXP( AV ) |
|
5 C |
|
6 C GENerate EXPonential random deviate |
|
7 C |
|
8 C |
|
9 C Function |
|
10 C |
|
11 C |
|
12 C Generates a single random deviate from an exponential |
|
13 C distribution with mean AV. |
|
14 C |
|
15 C |
|
16 C Arguments |
|
17 C |
|
18 C |
|
19 C AV --> The mean of the exponential distribution from which |
|
20 C a random deviate is to be generated. |
|
21 C REAL AV |
|
22 C |
|
23 C GENEXP <-- The random deviate. |
|
24 C REAL GENEXP |
|
25 C |
|
26 C |
|
27 C Method |
|
28 C |
|
29 C |
|
30 C Renames SEXPO from TOMS as slightly modified by BWB to use RANF |
|
31 C instead of SUNIF. |
|
32 C |
|
33 C For details see: |
|
34 C |
|
35 C Ahrens, J.H. and Dieter, U. |
|
36 C Computer Methods for Sampling From the |
|
37 C Exponential and Normal Distributions. |
|
38 C Comm. ACM, 15,10 (Oct. 1972), 873 - 882. |
|
39 C |
|
40 C********************************************************************** |
|
41 C .. Scalar Arguments .. |
|
42 REAL av |
|
43 C .. |
|
44 C .. External Functions .. |
|
45 REAL sexpo |
|
46 EXTERNAL sexpo |
|
47 C .. |
|
48 C .. Executable Statements .. |
|
49 genexp = sexpo()*av |
|
50 RETURN |
|
51 |
|
52 END |