|
|
@@ -229,7 +229,7 @@ struct polynomial |
|
|
|
return array<T> { solutions[0] - k }; |
|
|
|
|
|
|
|
// if root of the derivative is also root of the current polynomial, we have a double root. |
|
|
|
for (auto root : polynomial<T>{c, T(2)*b, T(3)*a}.roots()) |
|
|
|
for (auto root : (polynomial<T>{ c, T(2) * b, T(3) * a }).roots()) |
|
|
|
if (eval(root) == T(0)) |
|
|
|
return array<T> { (solutions[0] + solutions[2]) / T(2) - k, |
|
|
|
solutions[1] - k }; |
|
|
|