[Libreoffice-bugs] [Bug 137679] Implement a Kahan summation algorithm for reduce the numerical error in the total

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Apr 20 05:46:20 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=137679

--- Comment #15 from Mike Kaganski <mikekaganski at hotmail.com> ---
(In reply to b. from comment #14)

I agree that order of RAWSUBTRACT is inconsistent with normal subtraction. As
you wrote in bug 141752 comment 0,

=1E+016 - 1 - 1E+016 gives 0, while
=RAWSUBTRACT(1E+016;1;1E+016) gives -1;

=1E+016 - 1E+016 - 1 gives -1, while
=RAWSUBTRACT(1E+016;1E+016;1) gives 0.

This is due to natural processing order of the arguments of a function in Calc,
(that is *unspecified* by ODF!) and reversing it is possible here (forming a
vector of arguments before performing negations), but is completely useless in
view of Kahan summation algorithm (which is not complex by the way, just needs
an easy hacker to handle it).

Your bug was actually useful that it highlighted that RAWSUBTRACT is also a
subject to the Kahan (or more precisely, improved Kahan–Babuška) algorithm
implementation, so also is covered by this bug. Spending even one minute on an
alternative "fix" of bug 141752 is just a waste of developers' time , and I
disagree with "unduping" (but anyone is still free to suggest a patch with
"alternative" fix that would make a single person in the universe happy).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210420/8892d08b/attachment.htm>


More information about the Libreoffice-bugs mailing list