G01 Chapter Contents
G01 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentG01ZUF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

G01ZUF is used to initialize routines G01EUF and G01MUF.
It is intended to be used before a call to G01EUF or G01MUF.

## 2  Specification

 SUBROUTINE G01ZUF ( RKAPPA, BETA2, MODE, XL, XU, RCOMM, IFAIL)
 INTEGER MODE, IFAIL REAL (KIND=nag_wp) RKAPPA, BETA2, XL, XU, RCOMM(322)

## 3  Description

G01ZUF initializes the array RCOMM for use by G01EUF or G01MUF 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 G01EUF or G01MUF can be made following a single call to G01ZUF, provided that RKAPPA or BETA2 do not change, and that either all calls are to G01EUF or all calls are to G01MUF. If you wish to call both G01EUF and G01MUF, then you will need to initialize both separately.

## 4  References

Schorr B (1974) Programs for the Landau and the Vavilov distributions and the corresponding random numbers Comp. Phys. Comm. 7 215–224

## 5  Parameters

1:     $\mathrm{RKAPPA}$ – REAL (KIND=nag_wp)Input
On entry: the argument $\kappa$ of the function.
Constraint: $0.01\le {\mathbf{RKAPPA}}\le 10.0$.
2:     $\mathrm{BETA2}$ – REAL (KIND=nag_wp)Input
On entry: the argument ${\beta }^{2}$ of the function.
Constraint: $0.0\le {\mathbf{BETA2}}\le 1.0$.
3:     $\mathrm{MODE}$ – INTEGERInput
On entry: if ${\mathbf{MODE}}=0$, then G01MUF is to be called after the call to G01ZUF. Otherwise, G01EUF is to be called.
4:     $\mathrm{XL}$ – REAL (KIND=nag_wp)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 G01MUF and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by G01EUF if $\lambda <{x}_{l}$.
5:     $\mathrm{XU}$ – REAL (KIND=nag_wp)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 G01MUF and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to unity by G01EUF if $\lambda >{x}_{u}$.
6:     $\mathrm{RCOMM}\left(322\right)$ – REAL (KIND=nag_wp) arrayCommunication Array
On exit: this parameter should be passed unchanged to G01EUF or G01MUF.
7:     $\mathrm{IFAIL}$ – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{RKAPPA}}<0.01$, or ${\mathbf{RKAPPA}}>10.0$, or ${\mathbf{BETA2}}<0.0$, or ${\mathbf{BETA2}}>1.0$.
${\mathbf{IFAIL}}=2$
The initialization has been abandoned due to an internal error. This error exit is unlikely to occur, but if it does change the values of RKAPPA and/or BETA2 and rerun G01ZUF.
${\mathbf{IFAIL}}=-99$
See Section 3.8 in the Essential Introduction for further information.
${\mathbf{IFAIL}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
${\mathbf{IFAIL}}=-999$
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

## 7  Accuracy

At least five significant digits are usually correct.

Not applicable.