예제 #1
0
        public double NextGaussian(double mean, double sd)
        {
            var uni1 = SiriusRandomProvider.GetRandom();
            var uni2 = SiriusRandomProvider.GetRandom();

            Next = (mean + sd * (Math.Sqrt(-2 * Math.Log(uni1.NextDouble()))) * Math.Sin(2 * Math.PI * uni2.NextDouble()));
            return(Next);
        }
예제 #2
0
        public GaussianDistribution(double mean, double sd)
        {
            Mean = mean;
            SD   = sd;

            var uni1 = SiriusRandomProvider.GetRandom();
            var uni2 = SiriusRandomProvider.GetRandom();

            Next = (mean + sd * (Math.Sqrt(-2 * Math.Log(uni1.NextDouble()))) * Math.Sin(2 * Math.PI * uni2.NextDouble()));
        }