Bug 142933

Summary: Use Kahan summation algorithm for "+" and "-" operators
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: dante19031999, erack, newbie-02
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=137679
https://bugs.documentfoundation.org/show_bug.cgi?id=146367
Whiteboard:
Crash report or crash signature: Regression By:

Description Mike Kaganski 2021-06-18 14:44:39 UTC
Chained summation operations like "=1.5+2^52-2^52" could benefit from Kahan algorithm implemented in tdf#137679. To do that, possibly we should change tokenizer (?), so that it treats several summation operations on the same level as one operation analogous to SUM.

It should definitely not chain summations grouped by parentheses (I guess, it would be automatic, since operations inside parentheses are not "on the same level"). So e.g. "=(1.5+2^52)-2^52" would still return 2.
Comment 1 dante19031999 2021-06-22 16:36:07 UTC
Summation of 2/3 terms won't really benefit much from Kahan.
Let's hope there are not much extreme cases.
tokenizer falls out of range of my knowledge. And also have to finish Kahan AVX once I finish my exams and some starmath related projects.

Maybe it would be wise to modify the function wizard and specify in the description of SUM function that Kahan is being used. That they're different things and also notice in the documentation. Affectd file:
https://opengrok.libreoffice.org/xref/core/sc/inc/scfuncs.hrc?r=24552a0b#955
/core/sc/inc/scfuncs.hrc:955