pub fn beta_inv(q: f64, alpha: f64, beta: f64) -> Result<f64>
Inverse CDF for a Beta distribution, with fail-closed bounds checking.