1 /* -*-C-*- randl.c */
2
3 #include "elefunt.h"
4
5 /***********************************************************************
6
7 Returns pseudo random numbers logarithmically distributed over
8 (1,exp(x)). Thus a*randl(ln(b/a)) is logarithmically distributed
9 in (a,b).
10
11 Other subroutines required:
12
13 exp(x) - The exponential routine.
14
15 ran(k) - A function program returning random real
16 numbers uniformly distributed over (0,1). The
17 argument k is a dummy.
18
19 ***********************************************************************/
20
21 #if STDC
sp_t(srandl)22 sp_t
23 (srandl)(sp_t x)
24 #else /* NOT STDC */
25 sp_t
26 (srandl)(x)
27 sp_t x;
28 #endif /* STDC */
29 {
30 return (EXP(x * RAN()));
31 }
32