nag_init_vavilov (g01zuc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_init_vavilov (g01zuc)

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

nag_init_vavilov (g01zuc) is used to initialize functions nag_prob_vavilov (g01euc) and nag_prob_density_vavilov (g01muc).
It is intended to be used before a call to nag_prob_vavilov (g01euc) or nag_prob_density_vavilov (g01muc).

2  Specification

#include <nag.h>
#include <nagg01.h>
void  nag_init_vavilov (double rkappa, double beta2, Integer mode, double *xl, double *xu, double comm_arr[], NagError *fail)

3  Description

nag_init_vavilov (g01zuc) initializes the array comm_arr for use by nag_prob_vavilov (g01euc) or nag_prob_density_vavilov (g01muc) in the evaluation of the Vavilov functions ϕVλ;κ,β2 and ΦVλ;κ,β2 respectively.
Multiple calls to nag_prob_vavilov (g01euc) or nag_prob_density_vavilov (g01muc) can be made following a single call to nag_init_vavilov (g01zuc), provided that rkappa or beta2 do not change, and that either all calls are to nag_prob_vavilov (g01euc) or all calls are to nag_prob_density_vavilov (g01muc). If you wish to call both nag_prob_vavilov (g01euc) and nag_prob_density_vavilov (g01muc), 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  Arguments

1:     rkappadoubleInput
On entry: the argument κ of the function.
Constraint: 0.01rkappa10.0.
2:     beta2doubleInput
On entry: the argument β2 of the function.
Constraint: 0.0beta21.0.
3:     modeIntegerInput
On entry: if mode=0, then nag_prob_density_vavilov (g01muc) is to be called after the call to nag_init_vavilov (g01zuc). Otherwise, nag_prob_vavilov (g01euc) is to be called.
4:     xldouble *Output
On exit: xl, a threshold value below which ϕVλ;κ,β2 will be set to zero by nag_prob_density_vavilov (g01muc) and ΦVλ;κ,β2 will be set to zero by nag_prob_vavilov (g01euc) if λ<xl.
5:     xudouble *Output
On exit: xu, a threshold value above which ϕVλ;κ,β2 will be set to zero by nag_prob_density_vavilov (g01muc) and ΦVλ;κ,β2 will be set to unity by nag_prob_vavilov (g01euc) if λ>xu.
6:     comm_arr[322]doubleCommunication Array
On exit: this argument should be passed unchanged to nag_prob_vavilov (g01euc) or nag_prob_density_vavilov (g01muc).
7:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_BAD_PARAM
On entry, argument 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.
NE_REAL
On entry, beta2=value.
Constraint: beta21.0.
On entry, beta2=value.
Constraint: beta20.0.
On entry, rkappa=value.
Constraint: rkappa10.0.
On entry, rkappa=value.
Constraint: rkappa0.01.

7  Accuracy

At least five significant digits are usually correct.

8  Further Comments

None.

9  Example

See Section 9 in nag_prob_density_vavilov (g01muc) and nag_prob_vavilov (g01euc).

nag_init_vavilov (g01zuc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012