Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

[Phys-L] RNG "quality"?



using (JD suggestion)


#include <random>

using namespace std;



random_device seed;
mt19937 gen(seed());


in loop:


normal_distribution<double> distribution(0.00,0.20);

noise = distribution(gen);


for 1e6 iterations:

mean: ~ -9 E-5 and
SD: ~ 0.19990

While 1e4 is

0.0024 and

2.0244

Others observe the expected changes.


Is this gud?

bc; now incorporating into pendulum simulation, and discovered OS X uses clang not GCC