Return a sample from an approximate normal distribution with a mean of \(\mu=0\) and a standard deviation of \(\sigma=1\). In this approximate distribution, \(x\in[-6,6]\).
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public, | dimension(12) | :: | x |
function randomNormal() result(o)
!! Return a sample from an approximate normal distribution
!! with a mean of \(\mu=0\) and a standard deviation of
!! \(\sigma=1\). In this approximate distribution, \(x\in[-6,6]\).
real(wp)::o
real(wp),dimension(12)::x
call random_number(x)
o = sum(x)-6.0_wp
end function randomNormal