ipfrs_tensorlogic/markov_decision_process/functions.rs
1//! Auto-generated module
2//!
3//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
4
5/// Xorshift64 pseudo-random number generator step; updates `state` in-place
6/// and returns the new value.
7#[inline]
8pub fn xorshift64(state: &mut u64) -> u64 {
9 let mut x = *state;
10 x ^= x << 13;
11 x ^= x >> 7;
12 x ^= x << 17;
13 *state = x;
14 x
15}
16/// Produce a uniform f64 in [0, 1) from an xorshift64 state.
17#[inline]
18pub fn xorshift_f64(state: &mut u64) -> f64 {
19 (xorshift64(state) >> 11) as f64 / (1u64 << 53) as f64
20}