This commit is contained in:
Simon Gardling
2022-03-31 09:54:39 -04:00
parent 68b4eb9454
commit 9ea2a47246
4 changed files with 14 additions and 17 deletions

View File

@@ -260,7 +260,7 @@ pub fn newtons_method_helper(
.filter(|(prev, curr)| !prev.y.is_nan() && !curr.y.is_nan())
.filter(|(prev, curr)| prev.y.signum() != curr.y.signum())
.map(|(prev, _)| prev.x)
.map(|start_x| newtons_method(f, f_1, &start_x, &range, &threshold).unwrap_or(f64::NAN))
.map(|start_x| newtons_method(f, f_1, &start_x, range, threshold).unwrap_or(f64::NAN))
.filter(|x| !x.is_nan())
.collect()
}