13 use,
intrinsic :: iso_fortran_env
31 integer(int64),
intent(inout) :: seed
32 integer,
intent(in) :: n
34 real(real64) :: values(1:n, 1:2)
36 real(real64) :: flat(1:2*n)
37 real(real64) :: R(n), Theta(n)
42 r =
sqrt(-2.0_real64 *
log(1.0_real64 - flat(1:n)))
43 theta = 2.0_real64 *
m_pi * flat(n+1:2*n)
45 values(:,1) = r *
cos(theta)
46 values(:,2) = r *
sin(theta)
double log(double __x) __attribute__((__nothrow__
double sin(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
This module provides a random number generator for a normalized gaussian distribution.
real(real64) function, dimension(1:n, 1:2), public normal_distribution_get_random(seed, n)
This function implements the Box Mueller algorithm to produce n pairs of normal distributed random nu...
real(real64), parameter, public m_pi
some mathematical constants
subroutine, public shiftseed(iseed, n)