next up previous index
Next: G900 Random Number Up: CERNLIB Previous: G115 Approximate Vavilov

G116 Vavilov Density and Distribution Functions

Routine ID: G116
Author(s): B. Schorr, K.S. KölbigLibrary: MATHLIB
Submitter: K.S. KölbigSubmitted: 10.12.1993
Language: FortranRevised:

The VVILOV package contains subprograms for the calculation of the Vavilov density and distribution functions. Though generally more accurate, these routines are considerably slower than those in VAVLOV (G115).

For κ>0 and 0 ≤β2≤1 , the Vavilov density function is mathematically defined by

φV(λ;κ,β2) = {12πi} ∫c-i&inf;c+i&inf;eλs f(s;κ,β2) ds,

where c is an arbitrary real constant and

f(s;κ,β2) = C(κ,β2) exps lnκ+ (s+κβ2) [ ln({sκ})+E1({sκ}) ]-κ exp(-{sκ}) .

E1(x)=∫0xt-1 (1-e-t) dt is the exponential integral, C(κ,β2)=expκ(1+β2γ) , and γ=0.57721...  is Euler's constant.

The Vavilov distribution function is defined by

ΦV(λ;κ,β2) = ∫-&inf;λφV(λ;κ,β2) dλ.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names: VVISET, VVIDEN, VVIDIS
Internal Entry Names: G116F1, G116F2
External References: RZERO (C205), RSININ, RCOSIN (C336), REXPIN (C337)
COMMON Block Names and Lenghts: /G116C1/ 322

Usage:

    CALL VVISET(RKAPPA,BETA2,MODE,XL,XU)
sets auxiliary quantities used in VVIDEN and VVIDIS; this call has to precede a reference to either of these entries.
RKAPPA
The variable κ (the straggling parameter); (0.01 ≤κ≤12 ).
BETA2
The variable β2 (the square of velocity in unit c); (0 ≤β2≤1 ).
MODE
= 0 if VVIDEN is referenced after the call to VVISET;
= 1 if VVIDIS is referenced after the call to VVISET.
XL,XU
On exit, XL and XU contain a lower and upper limit as defined below.
In any arithmetic expression,
VVIDEN(X)φV(X;RKAPPA,BETA2) ,
VVIDIS(X)ΦV(X;RKAPPA,BETA2) ,

By definition
VVIDEN(X)=0 X<XL ; VVIDIS(X)=0 X<XL ;
VVIDEN(X)=0 X>XU ; VVIDIS(X)=1 X>XU .

RKAPPA, BETA2, XL and XU are defined by the last call to VVISET (with MODE=0 ) prior to a reference to VVIDEN, or (with MODE=1 ) prior to a reference to VVIDIS.

VVIDEN, VVIDIS and X, RKAPPA, BETA2, XL, XU are of type REAL, and MODE is of type INTEGER.

Method:

The method, based on Fourier expansions, is described in Ref. 1.

Accuracy:

About five significant digits are usually accurate.

Error handling:

Error G116.1: κ<0.01 or κ>10 .
Error G116.2: β2>1 .
These errors can occur when calling VVISET. In both cases, a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

Notes:

  1. Representing the Vavilov functions by approximations which are both fast and accurate is a difficult task. These routines, though rather accurate, are slow. If speed is of higher importance than accuracy, and for calculating Vavilov random numbers, use VAVLOV (G115).
  2. For κ≤0.01 , the Vavilov distribution can be replaced by the Landau distribution ( LANDAU (G110)), taking into account that λV=(λL-lnκ)/κ .
  3. For κ≥10 , the Vavilov distribution can be replaced by the Gaussian distribution with mean
    μ=γ-1-β2-lnκ and variance σ2=(2-β2)/(2κ) .

References:

  1. B. Schorr, Programs for the Landau and the Vavilov distributions and the corresponding random numbers, Computer Phys. Comm. 7 (1974) 215--224.

G900



next up previous index
Next: G900 Random Number Up: CERNLIB Previous: G115 Approximate Vavilov


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995