The Random
class supplies the nextGaussian
method, a random Gaussian with a mean of 0
and a standard deviation of 1
.
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
Try
rand = rnd.nextGaussian() * Math.sqrt(v) + m;
The Math.sqrt
is in there to convert a variance to standard deviation.