diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-04-20 17:10:32 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-04-20 17:10:32 +0200 |
commit | 86f2bdfd5767ddb79d2404b1a13116d01690e1e6 (patch) | |
tree | 28ab9c6c43f3ae858302dc363113b60dadeb97fc /aberth | |
parent | d54358b5338495bc7b90dc1fcac5f2c9734e9e89 (diff) |
Fix blatant error in C++ code
Diffstat (limited to 'aberth')
-rw-r--r-- | aberth/aberth.cpp | 2 |
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); |