Host Distributions#

oneMKL RNG routines are used to generate random numbers with different types of distribution. Each function group is introduced below by the type of underlying distribution and contains a short description of its functionality, as well as specifications of the call sequence and the explanation of input and output parameters. Table Continuous Distribution Generators and Table Discrete Distribution Generators list the random number generator routines with data types and output distributions, and sets correspondence between data types of the generator routines and the basic random number generators.

Table Continuous Distribution Generators

Routine

Description

uniform (continuous)

Uniform continuous distribution on the interval [a,b)

gaussian

Normal (Gaussian) distribution

exponential

Exponential distribution

laplace

Laplace distribution (double exponential distribution)

weibull

Weibull distribution

cauchy

Cauchy distribution

rayleigh

Rayleigh distribution

lognormal

Lognormal distribution

gumbel

Gumbel (extreme value) distribution

gamma

Gamma distribution

beta

Beta distribution

chi_square

Chi-Square distribution

gaussian_mv

Normal Multivariate (Gaussian Multivariate) distribution

Table Discrete Distribution Generators

Type of Distribution

Description

uniform (discrete)

Uniform discrete distribution on the interval [a,b)

uniform_bits

Uniformly distributed bits in 32/64-bit chunks

bits

Bits of underlying BRNG integer recurrence

bernoulli

Bernoulli distribution

geometric

Geometric distribution

binomial

Binomial distribution

hypergeometric

Hypergeometric distribution

poisson

Poisson distribution

poisson_v

Poisson distribution with varying mean

negative_binomial

Negative binomial distribution, or Pascal distribution

multinomial

Multinomial distribution

Modes of random number generation

The library provides two modes of random number generation, accurate and fast. Accurate generation mode is intended for applications that are highly demanding to accuracy of calculations. When used in this mode, the generators produce random numbers lying completely within the definitional domain for all values of the distribution parameters. For example, random numbers obtained from the generator of continuous distribution that is uniform on interval [a,b] belong to this interval irrespective of what a and b values may be. Fast mode provides high performance generation and also guarantees that generated random numbers belong to the definitional domain except for some specific values of distribution parameters. The generation mode is set by specifying the relevant value of the method parameter in generator routines. The list of distributions that support accurate mode of generation is given in the table below.

Table Distribution Generators with Accurate Method

Distribution

Method

uniform (continuous)

oneapi::mkl::rng::unform_method::accurate

exponential

oneapi::mkl::rng::exponential_method::icdf_accurate

weibull

oneapi::mkl::rng::weibull_method::icdf_accurate

rayleigh

oneapi::mkl::rng::rayleigh_method::icdf_accurate

lognormal

oneapi::mkl::rng::lognormal_method::box_muller2_accurate, oneapi::mkl::rng::lognormal_method::icdf_accurate

gamma

oneapi::mkl::rng::gamma_method::marsaglia_accurate

beta

oneapi::mkl::rng::beta_method::cja_accurate

Parent topic: Random Number Generators Host Routines