The generator for Gaussian random numbers can generate two independent samples, but we are currently discarding one of them. We can improve the code to keep the second sample in memory to return it in the next call to the generator. This should improve efficiency.
See https://en.wikipedia.org/wiki/Marsaglia_polar_method
Reactions are currently unavailable
The generator for Gaussian random numbers can generate two independent samples, but we are currently discarding one of them. We can improve the code to keep the second sample in memory to return it in the next call to the generator. This should improve efficiency.
DiffSharp/src/DiffSharp.Core/Util.fs
Line 48 in f1fb160
See https://en.wikipedia.org/wiki/Marsaglia_polar_method