d01gz calculates the optimal coefficients for use by (D01GCF not in this release) d01gd, when the number of points is the product of two primes.
- Type: System..::..Int32On entry: , the number of dimensions of the integral.Constraint: .
- Type: System..::..Int32On entry: the larger prime factor of the number of points in the integration rule.Constraint: must be a prime number .
- Type: System..::..Int32On entry: the smaller prime factor of the number of points in the integration rule. For maximum efficiency, should be close to .Constraint: must be a prime number such that .
Korobov (1963) gives a procedure for calculating optimal coefficients for -point integration over the -cube , when the number of points is
where and are distinct prime numbers.
The advantage of this procedure is that if is chosen to be the nearest prime integer to , then the number of elementary operations required to compute the rule is of the order of which grows less rapidly than the number of operations required by d01gy. The associated error is likely to be larger although it may be the only practical alternative for high values of .
Korobov N M (1963) Number Theoretic Methods in Approximate Analysis Fizmatgiz, Moscow
Errors or warnings detected by the method:
On entry, . On entry, , or , or .
- The value exceeds the largest integer representable on the machine, and hence the optimal coefficients could not be used in a valid call of (D01GCF not in this release) d01gd.
On entry, np1 is not a prime number. On entry, np2 is not a prime number.
The optimal coefficients are returned as exact integers (though stored in a real array).
This example calculates the Korobov optimal coefficients where the number of dimensons is and the number of points is the product of the two prime numbers, and .