```
``` function createRandomNumberGenerator() {
var a = 8121
var b = 28411
var c = 134456
var previous = 1
return function() {
previous = (b * previous + c) % a
return previous / a
}
}
var randomNumberGenerator = createRandomNumberGenerator()
function normallyDistributedNumberGenerator() {
let u = 1 - randomNumberGenerator(), v = 1 - randomNumberGenerator()
return Math.sqrt(-2 * Math.log(u)) * Math.cos(2 * Math.PI * v) // this gives just the x-coordinates of the distribution
}