Skip to main content

Module normal

Module normal 

Source
Expand description

Normal (Gaussian) distribution — pdf / cdf / quantile, the canonical engine-wide implementation. The CDF is ½·erfc(−z/√2) over the shared super::special::erfc (full precision), and the quantile is Acklam’s rational inverse refined by one Halley step (≈ machine precision). Domain libraries (financial_modeling’s Black–Scholes, etc.) should call these instead of re-deriving a local normal_cdf.

Functions§

cdf
Normal cdf with mean mu, std-dev sigma (> 0).
pdf
Normal pdf with mean mu, std-dev sigma (> 0).
quantile
Inverse normal cdf with mean mu, std-dev sigma.
standard_cdf
Standard-normal cdf Φ(z) = ½·erfc(−z/√2).
standard_pdf
Standard-normal pdf φ(z).
standard_quantile
Inverse standard-normal cdf Φ⁻¹(p), 0 < p < 1 (Acklam + one Halley refinement). ±∞ at the endpoints.
two_sided_p
Two-sided p-value for a standard-normal (z) statistic: 2·(1 − Φ(|z|)).