Documentation
¶
Overview ¶
Package xoroshiro128ss implements xoroshiro128** 1.0, one of our all-purpose, rock-solid, small-state generators. It is extremely (sub-ns) fast and it passes all tests we are aware of, but its state space is large enough only for mild parallelism.
For generating just floating-point numbers, xoroshiro128+ is even faster (but it has a very mild bias, see notes in the comments).
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.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a random source using xoroshiro128** algorithm.
Go port of http://prng.di.unimi.it/xoroshiro128starstar.c
Example ¶
package main
import (
"fmt"
"math/rand"
"github.com/shogo82148/randsrc/xoroshiro128ss"
)
func main() {
src := xoroshiro128ss.New([2]uint64{1})
r := rand.New(src)
for i := 0; i < 10; i++ {
fmt.Println(r.Int63())
}
}
Output: 2880 48507128640 8305045906563009344 4611698629741136713 7912389908774368352 6226882119986805214 4157124678997014974 7707811687779445541 8305244408713002896 8529798522661292347