예제 #1
0
double gauss_diff(){
  static pfi::math::random::random<mersenne_twister> r;
  static double last_val = r.next_gaussian();
  double cur_val = r.next_gaussian();
  double ret = (last_val-cur_val)/sqrt(2.0);
  last_val=cur_val;
  return ret;
}
예제 #2
0
double gauss_shifted(){
  static pfi::math::random::random<mersenne_twister> r;
  return (r.next_gaussian(42.0, 24.0)-42.0)/24.0;
}
예제 #3
0
double gauss(){
  static pfi::math::random::random<mersenne_twister> r;
  return r.next_gaussian();
}