Skip to content

Commit

Permalink
[3.12] gh-111933: fix broken link to A.Neumaier article (gh-111937) (g…
Browse files Browse the repository at this point in the history
  • Loading branch information
miss-islington authored Nov 12, 2023
1 parent 13ca1f0 commit 158a7e1
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 @@ -2605,7 +2605,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 158a7e1

Please sign in to comment.