NAG Library Routine Document

g01zuf  (init_vavilov)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

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

Fortran Interface
Subroutine g01zuf ( rkappa, beta2, mode, xl, xu, rcomm, ifail)
Integer, Intent (In):: mode
Integer, Intent (Inout):: ifail
Real (Kind=nag_wp), Intent (In):: rkappa, beta2
Real (Kind=nag_wp), Intent (Out):: xl, xu, rcomm(322)
C Header Interface
#include nagmk26.h
void  g01zuf_ ( const double *rkappa, const double *beta2, const Integer *mode, double *xl, double *xu, double rcomm[], Integer *ifail)

3
Description

g01zuf initializes the array rcomm for use by g01euf or g01muf in the evaluation of the Vavilov functions ϕVλ;κ,β2 and ΦVλ;κ,β2 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
Arguments

1:     rkappa – Real (Kind=nag_wp)Input
On entry: the argument κ of the function.
Constraint: 0.01rkappa10.0.
2:     beta2 – Real (Kind=nag_wp)Input
On entry: the argument β2 of the function.
Constraint: 0.0beta21.0.
3:     mode – IntegerInput
On entry: if mode=0, g01muf is to be called after the call to g01zuf. Otherwise, g01euf is to be called.
4:     xl – Real (Kind=nag_wp)Output
On exit: xl, a threshold value below which ϕVλ;κ,β2 will be set to zero by g01muf and ΦVλ;κ,β2 will be set to zero by g01euf if λ<xl.
5:     xu – Real (Kind=nag_wp)Output
On exit: xu, a threshold value above which ϕVλ;κ,β2 will be set to zero by g01muf and ΦVλ;κ,β2 will be set to unity by g01euf if λ>xu.
6:     rcomm322 – Real (Kind=nag_wp) arrayCommunication Array
On exit: this argument should be passed unchanged to g01euf or g01muf.
7:     ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ 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 argument, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, beta2=value.
Constraint: beta20.0.
On entry, beta2=value.
Constraint: beta21.0.
On entry, rkappa=value.
Constraint: rkappa0.01.
On entry, rkappa=value.
Constraint: rkappa10.0.
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.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

At least five significant digits are usually correct.

8
Parallelism and Performance

g01zuf is not threaded in any implementation.

9
Further Comments

None.

10
Example

See Section 10 in g01muf and g01euf.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017