boost::normal_distribution<>(boost::mt19937) changed behavior from 1.60 to 1.80
Dear All,
I'm not certain if the behavior I'm seeing is expected or a problem.
I'm getting different series of numbers from the two different boost versions in question.
When running a diff on the output I'm getting numbers inserted in one series or the other and then the two series become identical again.
Below is the source.
I'm using the following series of commands:
g++ -std=c++14 test.cpp -g -DNDEBUG -fwhole-program -I/mnt/share/boost/boost-1.80/include -o 180
g++ -std=c++14 test.cpp -g -DNDEBUG -fwhole-program -o 160
./180 16384 2078781393 1 > 180.txt
./160 16384 2078781393 1 > 160.txt
diff 160.txt 180.txt |more
The first difference is at line 284. The next at 364, 1783, 2685.
Peter
PS.
g++ (GCC) 5.3.0
PPS.
The source
#include
Am 18.07.23 um 14:18 schrieb Foelsche, Peter via Boost:
I'm not certain if the behavior I'm seeing is expected or a problem.
I'm getting different series of numbers from the two different boost versions in question.
The change is actually in Boost 1.64 which "improved the normal distribution" with https://github.com/boostorg/random/commit/c7d1b4f3516098b3e2fc8f8531d716881a... Discussion is in https://github.com/boostorg/random/pull/23 Other seem to have noticed the changed behavior too: https://github.com/stan-dev/math/pull/601 Steven has to determine whether this is a regression or an (semi-)intended side effect. But AFAIK random number generators/distributions are not guaranteed to generate the same numbers using different versions of the library. Alex
participants (2)
-
Alexander Grund
-
Foelsche, Peter