From 685950d3f2ac8e893a23443f9e087294cce2c6fa Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Wed, 11 May 2022 09:56:33 -0700 Subject: Add random variable. --- random/include/random/normal.h | 9 +++++++++ random/include/random/random.h | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 random/include/random/normal.h (limited to 'random/include') diff --git a/random/include/random/normal.h b/random/include/random/normal.h new file mode 100644 index 0000000..bee32a9 --- /dev/null +++ b/random/include/random/normal.h @@ -0,0 +1,9 @@ +#pragma once + +/// Generate two samples from the standard normal distribution. +/// +/// |u| and |v| must be uniformly distributed in (0,1). +void normal2(double u, double v, double* z0, double* z1); + +/// Map a sample from a standard normal distribution to an arbitrary normal. +double normal_transform(double z, double mu, double sigma); diff --git a/random/include/random/random.h b/random/include/random/random.h index 5499f62..1f4a48d 100644 --- a/random/include/random/random.h +++ b/random/include/random/random.h @@ -1,3 +1,5 @@ #pragma once #include +#include + -- cgit v1.2.3