ExRandom
3.0
|
Algorithms N and V have been added to MPFR version 4.0.1 (2018-02-08).
The added functions are
These are considerably more efficient than unit_normal_distribution and unit_exponential_distribution with an MPFR floating-point type particular when the precision is large. Because these routines write directly into the memory for a mpfr_t, the CPU time is proportional to the precision. In contrast, u_rand, in order to allow the use of a wide range of floating point types, generates high precision floating point numbers using a sequence of arithmetic operations whose cost scales as the square of the precision.
The program mpfr_times.cpp compares the time for mpfr_nrandom with mpfr_grandom, an implementation of polar method for normal sampling which appeared in MPFR 3.1. This (with tx multiplied by 10) is used to generate the timing data in Table 2, columns C and D, of the paper. Also compared is the time for unit_normal_distribution<mpfr::mpreal>.