Skip to main content

Module functions

Module functions 

Source
Expand description

Auto-generated module

🤖 Generated with SplitRS

Constants§

EULER_MASCHERONI
Euler–Mascheroni constant γ ≈ 0.5772156649.

Functions§

box_muller
Box-Muller transform: return two independent N(0,1) values.
first_n_primes
Return the first n prime numbers.
gamma_fn
Gamma function Γ(z) = exp(log_gamma(z)).
halton_1d
Compute the 1D Halton sequence value at index i with base base.
log_gamma
Log-gamma function using Lanczos approximation.
normal_cdf
Standard normal CDF Φ(x) using rational approximation.
normal_ppf
Inverse normal CDF (probit function) via rational approximation.
regularized_incomplete_beta
Regularized incomplete beta function I_x(a, b).
sample_gamma
Sample from Gamma(shape, scale) using Marsaglia-Tsang method.
sample_truncated_normal
Sample from a truncated normal distribution N(mu, sigma²) on [a, b] using rejection sampling.
sample_without_replacement
Sample k distinct indices from 0..n without replacement.
scrambled_halton_1d
Compute scrambled Halton value at index i with base and permutation.
shuffle_fisher_yates
Fisher-Yates shuffle of a mutable slice in-place.
student_t_cdf
Approximate Student-t CDF using numerical integration.
weighted_choice
Weighted random choice from a slice of (value, weight) pairs.
weighted_choice_index
Choose an index from a probability vector given uniform variate u.