FAILURE MAP
← Case archive

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.

Member previewVariant 4 · 3 implementations · 7 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
unit spread on large baseline0.00.6666666666666666Failed

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 ↗