change exponential sample generation to c++11