Bug 142933 - Use Kahan summation algorithm for "+" and "-" operators
Summary: Use Kahan summation algorithm for "+" and "-" operators
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-18 14:44 UTC by Mike Kaganski
Modified: 2022-01-03 21:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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