public static double gaussian(){
  double r, x, y;
  do {
    x=uniform(-1.0,1.0);
    y=uniform(-1.0,1.0);
    r=x * x + y * y;
  }
 while (r >= 1 || r == 0);
  return x * Math.sqrt(-2 * Math.log(r) / r);
}

public static double gaussian ( ) { double r , x , y ; do { x = uniform ( - 1.0 , 1.0 ) ; y = uniform ( - 1.0 , 1.0 ) ; r = x * x + y * y ; } while ( r >= 1 || r == 0 ) ; return x * Math . sqrt ( - 2 * Math . log ( r ) / r ) ; }
return a real number with a standard gaussian distribution .
