Issue Details (XML | Word | Printable)

Key: CORE-6242
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Pavel Zotov
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

DECFLOAT. Implement high-accuracy algorithm for SUM of values with exponenta greater than 34.

Created: 02/Feb/20 07:26 PM   Updated: 03/Feb/20 12:43 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File neumaier-klein-builin_sum_-_results_comparison.sql (14 kB)


QA Status: No test


 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.