aboutsummaryrefslogtreecommitdiff
path: root/aberth
diff options
context:
space:
mode:
Diffstat (limited to 'aberth')
-rw-r--r--aberth/aberth.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/aberth/aberth.cpp b/aberth/aberth.cpp
index c5b037d..42e3106 100644
--- a/aberth/aberth.cpp
+++ b/aberth/aberth.cpp
@@ -158,7 +158,7 @@ struct AberthState {
Com derivval = eval(deriv, poly.size() - 1, approx[i]);
Com quo = pval / derivval;
Com sum = 0;
- for (int j = 0; j < i; j++) sum += pairs[N * j + i];
+ for (int j = 0; j < i; j++) sum -= pairs[N * j + i];
for (int j = i + 1; j < N; j++) sum += pairs[N * i + j];
offsets[i] = quo / (1.0 - quo * sum);