#include "random.h" #include double randn(void) { /* Generates a random number from a normal distribution using the * Box-Muller transform. */ double u1, u2; u1 = genrand_real1(); u2 = genrand_real1(); return sqrt(-2*log(u1))*cos(2*M_PI*u2); }