fix jittering of roots/extrema
This commit is contained in:
parent
cee58b1dc4
commit
605dd5ae18
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user