Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class xoshiro512d

boost::random::xoshiro512d

Synopsis

// In header: <boost/random/xoshiro.hpp>


class xoshiro512d {
public:

  // public member functions
  std::uint64_t next_int() noexcept;
  result_type next() noexcept;

  // public static functions
  static constexpr min() noexcept;
  static constexpr max() noexcept;
};

Description

This is xoshiro512+ 1.0, our generator for floating-point numbers with increased state size. We suggest to use its upper bits for floating-point generation, as it is slightly faster than xoshiro512**. It passes all tests we are aware of except for the lowest three bits, which might fail linearity tests (and just those), so if low linear complexity is not considered an issue (as it is usually the case) it can be used to generate 64-bit outputs, too.

We suggest to use a sign test to extract a random Boolean value, and right shifts to extract subsets of bits.

The state must be seeded so that it is not everywhere zero. If you have a 64-bit seed, we suggest to seed a splitmix64 generator and use its output to fill s.

xoshiro512d public member functions

  1. std::uint64_t next_int() noexcept;
  2. result_type next() noexcept;

xoshiro512d public static functions

  1. static constexpr min() noexcept;
  2. static constexpr max() noexcept;

PrevUpHomeNext