#include <iostream>

float 
gaussian_distribution() {

	float x1, x2, w, y1, y2;
 
         do {
                 x1 = 2.0 * rand()%2 - 1.0;
                 x2 = 2.0 * rand()%2 - 1.0;
                 w = x1 * x1 + x2 * x2;
         } while ( w >= 1.0 );

         w = sqrt((-2.0 * ln(w)) / w );
         y1 = x1 * w;
         
	return y1;
}

double
uniform_distribution() {

	double d, mean;
  	int num, i;

	srand48(time(0));

  	for (i = 0; i < num; i++) {
    		d = drand48() * mean * 2;
    		printf("%5.1lf\n", d);
   	}
}
