    Next: G116 Vavilov Density Up: CERNLIB Previous: G110 Landau Distribution

## G115 Approximate Vavilov Distribution and its Inverse

Routine ID: G115
Author(s): A. Rotondi, P. Montagna, K.S. KölbigLibrary: MATHLIB
Submitter: K.S. KölbigSubmitted: 10.12.1993
Language: FortranRevised:

The VAVLOV package contains subprograms for fast approximate calculation of functions related to the Vavilov distribution.

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λ

and its inverse by $\Psi$V(x;κ,β2)=ΦV-1(x;κ,β2) .

The function $\Psi$V(x;κ,β2) can be used to generate Vavilov random numbers (see Usage).

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names: VAVSET, VAVDEN, VAVDIS, VAVRND, VAVRAN
External References: LOCATF (E106), DENLAN, DISLAN (G110)
COMMON Block Names and Lenghts: /G115C1/ 226

Usage:

```    CALL VAVSET(RKAPPA,BETA2,MODE)
```
sets auxiliary quantities used in VAVDEN, VAVDIS and VAVRND; this call has to precede a reference to any 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
$= 1;$
$= 0$ in the particular case that VAVDEN only is referenced after the call to VAVSET.
In any arithmetic expression,
 VAVDEN(X) $\phi$V(X;RKAPPA,BETA2) , VAVDIS(X) $\Phi$V(X;RKAPPA,BETA2) , VAVRND(X) $\Psi$V(X;RKAPPA,BETA2) ,

RKAPPA and BETA2 are defined by the last call to VAVSET prior to a reference to VAVDEN, VAVDIS, or VAVRND.

To generate a set of Vavilov random numbers with identical $\kappa$

and $\beta 2$ , VAVSET should be called once and then VAVRND be referenced repeatedly, using as argument X a random number from a uniform distribution over the interval (0,1).

In any arithmetic expression, VAVRAN(RKAPPA,BETA2,X) has an approximate value of $\Psi$V(X;RKAPPA,BETA2) .

To generate one Vavilov random number for given values of $\kappa$

and $\beta 2$ , VAVRAN should be used, using as argument X a random number from a uniform distribution over the interval (0,1).

VAVDEN, VAVDIS, VAVRND, VAVRAN and X, RKAPPA, BETA2 are of type REAL, and MODE is of type INTEGER.

Method:

The method is discribed in Ref. 1.

Accuracy:

The accuracy depends on the parameters. Although often rather poor from a mathematical point of view, it is usually sufficient for the intended application in physics (see Notes).

Restrictions:

No test is made whether the parameters $\kappa$ and $\beta 2$

are in the specified ranges.

Notes:

1. Representing the Vavilov functions by approximations which are both fast and accurate is a difficult task. In view of the requirements in physics, speed is much more important than accuracy. This is taken into account for the present routines.
2. For a more accurate, but much slower, calculation of the Vavilov density and distribution functions, use VVILOV (G116).
3. 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κ)/κ .
4. 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. A. Rotondi and P. Montagna, Fast calculation of Vavilov distribution, Nucl. Instr. and Meth. B47 (1990) 215--224.
$•$    Next: G116 Vavilov Density Up: CERNLIB Previous: G110 Landau Distribution

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