Merge pull request #516 from gordicaleksa/update_random_doc

Add clarification on Box-Muller
This commit is contained in:
Andrej 2024-06-02 16:37:37 -07:00 committed by GitHub
commit 1ce30fdc4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,8 +163,8 @@ void uniform_(float* data, unsigned int numel, float from, float to, mt19937_sta
}
}
// Box<EFBFBD>Muller transform
// Box-Muller transform: maps uniform random numbers to Gaussian distributed numbers
// https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
void normal_fill_16(float* data, float mean, float std, mt19937_state* state) {
#define EPSILONE 1e-12
for (unsigned int t = 0; t < 8; t++) {