Boost logo

Boost Users :

Subject: [Boost-users] [Random] Change in normal_distribution behavior between Boost 1.49 and Boost 1.56
From: Jonathan Jones (Jonathan.Jones_at_[hidden])
Date: 2015-06-16 17:43:20


Hi folks,

Given the same set of inputs, this program is producing different answers
in Boost 1.56 as compared to Boost 1.49:

#include <boost/random/mersenne_twister.hpp>
#include <boost/random/normal_distribution.hpp>

int main()
{
    boost::normal_distribution<double> dist(0.0, 1.0);
    boost::mt19937 gen(0);

    for (int ii=1; ii <= 5; ++ii)
    {
        printf("%2d) %g\n", ii, dist(gen));
    }
}

I've isolated this to a change in the implementation of
normal_distribution between these two versions (mt19937 is producing the
same sequence of numbers with the same starting seed).

My question is, is there any guarantee that this distribution is going to
produce the same answers across different versions of Boost, given the
same starting seed (zero in this case)?

Thanks,
Jon


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net