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

                 Key: CORE-6242
                 URL: http://tracker.firebirdsql.org/browse/CORE-6242
             Project: Firebird Core
          Issue Type: Improvement
            Reporter: Pavel Zotov
            Priority: Minor
         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.





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to