Created
January 19, 2026 18:14
-
-
Save mattdesl/2dde1a0ffb896c63e0cce366712d4121 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function nextGaussianBoxMuller(mean = 0, standardDerivation = 1, rng = Math.random) { | |
| return ( | |
| mean + | |
| standardDerivation * | |
| (Math.sqrt(-2.0 * Math.log(rng())) * Math.cos(TWO_PI * rng())) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment