NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
rng_normal2 Interface Reference

Functions returning a variate x with normal probability. More...

Public Member Functions

real(dp) function ran_ugaussian2 ()
 Computes a Gaussian random variate, with mean zero and standard deviation sigma=1.
 
real(dp) function ran_gaussian_sym2 (scale)
 
real(dp) function ran_gaussian2 (loc, scale)
 ran_gaussian computes a Gaussian random variate, with mean zero and standard deviation sigma
 

Detailed Description

Functions returning a variate x with normal probability.

Valid uses:

USE numfor, only rng_normal
x = rng_normal2()
x = rng_normal2(scale)
x = rng_normal2(loc, scale)

This version is faster than rng_normal() but is not thread-safe

Member Function/Subroutine Documentation

◆ ran_gaussian2()

real(dp) function ran_gaussian2 ( real(dp), intent(in) loc,
real(dp), intent(in) scale )

ran_gaussian computes a Gaussian random variate, with mean zero and standard deviation sigma

Returns
Random number
Parameters
[in]locCenter of distribution
[in]scalestandard deviation

References gauss::ran_ugaussian2().

Here is the call graph for this function:

◆ ran_gaussian_sym2()

real(dp) function ran_gaussian_sym2 ( real(dp), intent(in) scale)
Returns
Random number
Parameters
[in]scalestandard deviation

References gauss::ran_ugaussian2().

Here is the call graph for this function:

◆ ran_ugaussian2()

real(dp) function ran_ugaussian2

Computes a Gaussian random variate, with mean zero and standard deviation sigma=1.

Note
This version caches the last unused value. It should be faster but will have problems in multi-threaded programs
Returns
Random number

The documentation for this interface was generated from the following file: