You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described here: https://en.wikipedia.org/wiki/Kahan_summation_algorithm - there is several ways to reduce accumulation of round errors during make SUM operation.
Consider script from attach and its results.
There is only one test case (column "test_no" = 1) which contains proper values in all thee columns: SUM() as it is implemented now, Neumaier and Klein-Kahan totalling. But these values has exponenta less than 34.
All other test cases contain at least one wrong result.
The best accuracy is demonstrated by Klein-Kahan algorithm, but is also has one flaw: example where test_no = 5 (proper results there must be exactly 0).
It will be useful to have alternate implementation for SUM() ( say, "SUM2()" ?) which will use some of algorithm with compensation of running totals.
The text was updated successfully, but these errors were encountered:
description: As described here: https://en.wikipedia.org/wiki/Kahan_summation_algorithm - there is several ways to reduce accumulation of round errors during make SUM operation.
Consider script from attach and its results.
There is only one test case (column "test_no" = 1) which contains proper values in all thee columns: SUM() as it is implemented now, Neumaier and Klein-Kahan totalling. But these values has exponenta less than 34.
All other test cases contain at least one wrong result.
The best accuracy is demonstrated by Klein-Kahan algorithm, but is also has one flaw: example where test_no = 5 (proper results there must be exactly 0).
It will be useful to have alternate implementation for SUM() ( say, "SUM2()" ?) which will use some of algorithm with compensation of running totals.
=>
As described here: https://en.wikipedia.org/wiki/Kahan_summation_algorithm - there is several ways to reduce accumulation of round errors during make SUM operation.
Consider script from attach and its results.
There is only one test case (column "test_no" = 1) which contains proper values in all thee columns: SUM() as it is implemented now, Neumaier and Klein-Kahan totalling. But these values has exponenta less than 34.
All other test cases contain at least one wrong result.
The best accuracy is demonstrated by Klein-Kahan algorithm, but is also has one flaw: example where test_no = 5 (proper results there must be exactly 0).
It will be useful to have alternate implementation for SUM() ( say, "SUM2()" ?) which will use some of algorithm with compensation of running totals.
Submitted by: @pavel-zotov
Attachments:
neumaier-klein-builin_sum_-_results_comparison.sql
As described here: https://en.wikipedia.org/wiki/Kahan_summation_algorithm - there is several ways to reduce accumulation of round errors during make SUM operation.
Consider script from attach and its results.
There is only one test case (column "test_no" = 1) which contains proper values in all thee columns: SUM() as it is implemented now, Neumaier and Klein-Kahan totalling. But these values has exponenta less than 34.
All other test cases contain at least one wrong result.
The best accuracy is demonstrated by Klein-Kahan algorithm, but is also has one flaw: example where test_no = 5 (proper results there must be exactly 0).
It will be useful to have alternate implementation for SUM() ( say, "SUM2()" ?) which will use some of algorithm with compensation of running totals.
The text was updated successfully, but these errors were encountered: