Пример #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();
}