Skip to content

Commit

Permalink
pythongh-111933: fix broken link to A.Neumaier article (pythongh-111937)
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev authored Nov 12, 2023
1 parent ce6a533 commit 12a30bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,10 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
}
if (PyFloat_CheckExact(item)) {
// Improved Kahan–Babuška algorithm by Arnold Neumaier
// https://www.mat.univie.ac.at/~neum/scan/01.pdf
// Neumaier, A. (1974), Rundungsfehleranalyse einiger Verfahren
// zur Summation endlicher Summen. Z. angew. Math. Mech.,
// 54: 39-51. https://doi.org/10.1002/zamm.19740540106
// https://en.wikipedia.org/wiki/Kahan_summation_algorithm#Further_enhancements
double x = PyFloat_AS_DOUBLE(item);
double t = f_result + x;
if (fabs(f_result) >= fabs(x)) {
Expand Down

0 comments on commit 12a30bc

Please sign in to comment.