mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The DST-boundary parity case seeds two readings on the same UTC day, so the windowed compose folds a closed form over a large epoch-day x (~20540). The n*Sxx - Sx^2 denominator subtracts two ~1e10 magnitudes and loses about ten significant digits to cancellation before the divide, so an absolute toBeCloseTo at 9 dp is the wrong gauge for a slope that small. The populator sums per-raw-reading accumulators grouped by day, so both paths regress over the identical raw-row x set and agree mathematically; the residual is float summation order alone. Switch all parity assertions to a shared relative tolerance (1e-9 of scale), far tighter than the 2-3 dp the read tier rounds to.