Skip to main content

normal_cdf_batch

Function normal_cdf_batch 

Source
pub fn normal_cdf_batch(xs: &[f64], mu: f64, sigma: f64) -> Vec<f64>
Expand description

Batch compute Normal CDF for an array of x values.

Computes Φ((xᵢ−µ)/σ) where Φ is the standard-normal CDF.

When the gpu_wgpu feature is enabled and a compatible GPU is available, computation is dispatched to a WGSL compute shader; otherwise the function falls back to a CPU loop using the A&S erf approximation.

§Arguments

  • xs — Input points at which to evaluate the CDF.
  • mu — Distribution mean µ.
  • sigma — Distribution standard deviation σ (must be positive).

§Returns

A Vec<f64> of the same length as xs, with values in [0, 1].