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 $\kappa >0$ and $0 \le \beta 2\le 1$ , the Vavilov density function is mathematically defined by

$\phi$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\left(s;\kappa ,\beta 2\right) = C\left(\kappa ,\beta 2\right) exps ln\kappa + \left(s+\kappa \beta 2\right) \left[ ln\left(\left\{s\kappa \right\}\right)+E$1({sκ}) ]-κ exp(-{sκ}) .

$E$1(x)=∫0xt-1 (1-e-t) dt is the exponential integral, $C\left(\kappa ,\beta 2\right)=exp\kappa \left(1+\beta 2\gamma \right)$ , and $\gamma =0.57721...$ is Euler's constant.

The Vavilov distribution function is defined by

$\Phi$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 $\kappa$ (the straggling parameter); ($0.01 \le \kappa \le 12$ ).
BETA2
The variable $\beta 2$ (the square of velocity in unit c); ($0 \le \beta 2\le 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) $\phi$V(X;RKAPPA,BETA2) , VVIDIS(X) $\Phi$V(X;RKAPPA,BETA2) ,

By definition
 $VVIDEN\left(X\right)=0$ $X ; $VVIDIS\left(X\right)=0$ $X ; $VVIDEN\left(X\right)=0$ $X>XU$ ; $VVIDIS\left(X\right)=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: $\kappa <0.01$ or $\kappa >10$ .
Error G116.2: $\beta 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 $\kappa \le 0.01$ , the Vavilov distribution can be replaced by the Landau distribution ( LANDAU (G110)), taking into account that $\lambda$V=(λL-lnκ)/κ .
3. For $\kappa \ge 10$ , the Vavilov distribution can be replaced by the Gaussian distribution with mean
$\mu =\gamma -1-\beta 2-ln\kappa$ and variance $\sigma 2=\left(2-\beta 2\right)/\left(2\kappa \right)$ .

References:

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

Next: G900 Random Number Up: CERNLIB Previous: G115 Approximate Vavilov

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