An Ada/SPARK port of the xoshiro128++ and xoshiro256++ pseudo-random number generators.
For a SIMD implementation using SSE2 or AVX2 intrinsics, see the orka_simd crate. It is used to create tensors with some statistical distribution.
declare
use Xoshiro256;
RNG : Generator;
Value : Unsigned_64;
begin
Reset (RNG, Seed => 1);
Next (RNG, Value);
Ada.Text_IO.Put_Line (To_Float (Value)'Image);
end;
In order to build the library, you need to have:
-
An Ada 2012 compiler
-
Alire package manager
The Ada code is licensed under the Apache License 2.0. The first line of each Ada file should contain an SPDX license identifier tag that refers to this license:
SPDX-License-Identifier: Apache-2.0