时间关系暂时先不介绍啥是正态分布了,网上关于生成正态分布随机数的方法也有很多。
下面是moro 逆正态累积分布函数(Moro's Inverse Cumulative Normal Distribution function)
double MoroInvCND(double prob)
{
const double a1 = 2.50662823884;
const double a2 = -18.61500062529;
const double a3 = 41.39119773534;
const double a4 = -25.44106049637;
const double b1 = -8.4735109309;
const double b2 = 23.08336743743;
const double b3 = -21.06224101826;
const double b4 = 3.13082909833;
const double c1 = 0.337475482272615;
const double c2 = 0.976169019091719;
const double c3 = 0.160797971491821;
const double c4 = 2.76438810333863E-02;
const double c5 = 3.8405729373609E-03;
const double c6 = 3.951896511919E-04;
const double c7 = 3.21767881768E-05;
const double c8 = 2.8881673