FA-329 / Floating-point arithmetic / Member archive
Subtracting two large moments destroys a small variance · case 04
A nonconstant sample reports zero or an inaccurate variance after its mean is shifted far from zero.
Case contract
Return statistics.pvariance for a nonempty sequence of finite floats; return None for empty input. This is population variance, so the denominator is n rather than n-1.
Why this case matters
Variance should not change when all observations receive the same offset. Large baselines with small spreads are a direct regression check for cancellation-prone moment formulas.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unit spread on large baseline | 0.0 | 0.6666666666666666 | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗