SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
rng Namespace Reference

Random number generation. More...

Classes

struct  basic_rng_t
 Random number generator wrapper around an rng engine. More...
 
struct  rng_t
 
struct  xorshift1024_t
 XORSHIFT-1024 Random Number Generator. More...
 
struct  xorshift128_t
 RNG Engines. More...
 
struct  xoshiro256plus_t
 xoshiro256+ Random Number Generator More...
 

Functions

double stdnormal_cdf (double u)
 The standard normal CDF, for one random variable. More...
 
double stdnormal_inv (double p)
 The inverse standard normal distribution. More...
 

Detailed Description

Random number generation.

Function Documentation

◆ stdnormal_cdf()

double rng::stdnormal_cdf ( double  u)

The standard normal CDF, for one random variable.

Author: W. J. Cody URL: http://www.netlib.org/specfun/erf Source: http://home.online.no/~pjacklam/notes/invnorm/

This is the erfc() routine only, adapted by the transform stdnormal_cdf(u)=(erfc(-u/sqrt(2))/2;

◆ stdnormal_inv()

double rng::stdnormal_inv ( double  p)

The inverse standard normal distribution.

This is used to get the normal distribution inverse for our user-specifiable confidence levels. For example for the default 95% confidence level, this function will return the well known number of 1.96, so we know that 95% of the distribution is between -1.96 and +1.96 std deviations from the mean.

Author: Peter John Acklam pjack.nosp@m.lam@.nosp@m.onlin.nosp@m.e.no URL: http://home.online.no/~pjacklam Source: http://home.online.no/~pjacklam/notes/invnorm/

This function is based on the MATLAB code from the address above, translated to C, and adapted for our purposes.