# NAG CL Interfaceg01zuc (init_​vavilov)

## 1Purpose

g01zuc is used to initialize functions g01euc and g01muc.
It is intended to be used before a call to g01euc or g01muc.

## 2Specification

 #include
 void g01zuc (double rkappa, double beta2, Integer mode, double *xl, double *xu, double comm_arr[], NagError *fail)
The function may be called by the names: g01zuc, nag_stat_init_vavilov or nag_init_vavilov.

## 3Description

g01zuc initializes the array comm_arr for use by g01euc or g01muc in the evaluation of the Vavilov functions ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ respectively.
Multiple calls to g01euc or g01muc can be made following a single call to g01zuc, provided that rkappa or beta2 do not change, and that either all calls are to g01euc or all calls are to g01muc. If you wish to call both g01euc and g01muc, then you will need to initialize both separately.
Schorr B (1974) Programs for the Landau and the Vavilov distributions and the corresponding random numbers Comp. Phys. Comm. 7 215–224

## 5Arguments

1: $\mathbf{rkappa}$double Input
On entry: the argument $\kappa$ of the function.
Constraint: $0.01\le {\mathbf{rkappa}}\le 10.0$.
2: $\mathbf{beta2}$double Input
On entry: the argument ${\beta }^{2}$ of the function.
Constraint: $0.0\le {\mathbf{beta2}}\le 1.0$.
3: $\mathbf{mode}$Integer Input
On entry: if ${\mathbf{mode}}=0$, g01muc is to be called after the call to g01zuc. Otherwise, g01euc is to be called.
4: $\mathbf{xl}$double * Output
On exit: ${x}_{l}$, a threshold value below which ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01muc and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01euc if $\lambda <{x}_{l}$.
5: $\mathbf{xu}$double * Output
On exit: ${x}_{u}$, a threshold value above which ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01muc and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to unity by g01euc if $\lambda >{x}_{u}$.
6: $\mathbf{comm_arr}\left[322\right]$double Communication Array
On exit: this argument should be passed unchanged to g01euc or g01muc.
7: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL
On entry, ${\mathbf{beta2}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{beta2}}\le 1.0$.
On entry, ${\mathbf{beta2}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{beta2}}\ge 0.0$.
On entry, ${\mathbf{rkappa}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{rkappa}}\le 10.0$.
On entry, ${\mathbf{rkappa}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{rkappa}}\ge 0.01$.

## 7Accuracy

At least five significant digits are usually correct.

## 8Parallelism and Performance

g01zuc is not threaded in any implementation.