~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/randlib/genexp.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

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