Skip to main content

normal_logcdf

Function normal_logcdf 

Source
pub fn normal_logcdf(x: f64) -> f64
Expand description

Numerically stable ln Φ(x) for the standard normal CDF. For x ≥ 0 computes ln(Φ(x)) directly with a small floor against underflow; for x < 0 rewrites ln Φ(x) = −u² + ln(½·erfcx(u)), u = −x/√2, which preserves digits all the way into the deep left tail (no ln(0)). Returns ±∞ and NaN at the corresponding inputs.