Hi,
have you thought about using Box Muller transform?
I would write
int n=1000000;
int BIG=1000000;
float x[i in 1..n]=-1+2*rand(BIG)/BIG;
float y[i in 1..n]=-1+2*rand(BIG)/BIG;;
float w[i in 1..n]=sqrt(x[i]*x[i]+y[i]*y[i]);
float w2[i in 1..n]=(w[i]<=1)?(-2*ln(w[i])/w[i]):-1;
float x2[i in 1..n]=(w[i]<=1)?x[i]*w2[i]:-1;
float y2[i in 1..n]=(w[i]<=1)?y[i]*w2[i]:-1;
the values of x2 and y2 when w<=1 obey a normal distribution
Regards
Alex
#DecisionOptimization#OPLusingCPLEXOptimizer