d01gyf calculates the optimal coefficients for use by
d01gcf and
d01gdf,
for prime numbers of points.
The
Korobov (1963) procedure for calculating the optimal coefficients
${a}_{1},{a}_{2},\dots ,{a}_{n}$ for
$p$-point integration over the
$n$-cube
${\left[0,1\right]}^{n}$ imposes the constraint that
where
$p$ is a prime number and
$a$ is an adjustable argument. This argument is computed to minimize the error in the integral
when computed using the number theoretic rule, and the resulting coefficients can be shown to fit the Korobov definition of optimality.
The computation for large values of
$p$ is extremely time consuming (the number of elementary operations varying as
${p}^{2}$) and there is a practical upper limit to the number of points that can be used. Routine
d01gzf is computationally more economical in this respect but the associated error is likely to be larger.
If on entry
${\mathbf{ifail}}=0$ or
$-1$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
The optimal coefficients are returned as exact integers (though stored in a real array).
The time taken is approximately proportional to
${p}^{2}$ (see
Section 3).
This example calculates the Korobov optimal coefficients where the number of dimensions is $4$ and the number of points is $631$.
None.