98 SUBROUTINE dlarnv( IDIST, ISEED, N, X )
110 DOUBLE PRECISION x( * )
116 DOUBLE PRECISION one, two
117 parameter( one = 1.0d+0, two = 2.0d+0 )
119 parameter( lv = 128 )
120 DOUBLE PRECISION twopi
121 parameter( twopi = 6.2831853071795864769252867663d+0 )
124 INTEGER i, il, il2, iv
127 DOUBLE PRECISION u( lv )
130 INTRINSIC cos, log, min, sqrt
137 DO 40 iv = 1, n, lv / 2
138 il = min( lv / 2, n-iv+1 )
139 IF( idist.EQ.3 )
THEN
148 CALL
dlaruv( iseed, il2, u )
150 IF( idist.EQ.1 )
THEN
157 ELSE IF( idist.EQ.2 )
THEN
162 x( iv+i-1 ) = two*u( i ) - one
164 ELSE IF( idist.EQ.3 )
THEN
169 x( iv+i-1 ) = sqrt( -two*log( u( 2*i-1 ) ) )*
170 $ cos( twopi*u( 2*i ) )