KeyrateQuantile
z_pe: two-sided normal quantiles, branch seam, tails and guards
5/5 passed in 0ms
| Test | What it does | Result |
|---|---|---|
test_z_extremes | The tail branch survives eps to 1e-300 without hitting the 1 - eps/2 == 1 rounding wall, and eps near 1 gives a small positive z. | ✅ pass |
test_z_finite_size | At the eps = 1e-10 the CV-QKD literature uses, z_pe gives 6.466951. | ✅ pass |
test_z_guards | eps outside (0, 1), NaN and infinity included, raises ValueError. | ✅ pass |
test_z_seam | Acklam's approximation switches branch at eps = 0.0485; straddling it by 1e-10 does not step z or reverse the ordering. | ✅ pass |
test_z_textbook | z_pe reproduces the textbook two-sided quantiles 1.959964 at 5%, 2.575829 at 1% and 3.290527 at 0.1%, to 1e-5. | ✅ pass |