fix jittering of roots/extrema

This commit is contained in:
Simon Gardling 2022-05-16 09:22:37 -04:00
parent cee58b1dc4
commit 605dd5ae18

View File

@ -256,8 +256,8 @@ fn newtons_method(
x1 = x2; x1 = x2;
} }
// If failed, return NaN, which is then filtered out // return x2 as loop breaks before x1 is set to x2
return Some(x1); return Some(x2);
} }
/// Inputs `Vec<Option<T>>` and outputs a `String` containing a pretty representation of the Vector /// Inputs `Vec<Option<T>>` and outputs a `String` containing a pretty representation of the Vector