The one-pass nSxy - SxSy form cancels catastrophically:
a = [1e8, 1e8, 1.00000002e8]
b = [1e8, 1e8, 1.00000003e8]
correlation "a" "b" df -- Just 2.0
a = [1e11, 1e11 + 1, 1e11 + 2]
correlation "a" "a" df -- Just (-1.0)
A centered two-pass form fixes both but doubles the passes, so it needs
profiling first (#214 review). Will send a PR with benchmarks.
The one-pass nSxy - SxSy form cancels catastrophically:
A centered two-pass form fixes both but doubles the passes, so it needs
profiling first (#214 review). Will send a PR with benchmarks.