From e3128593e2b58a8f2af5d8964c62a396035c46f9 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 2 Jun 2022 22:27:11 -0400 Subject: [PATCH] simplify newtons_method_helper Wohoo!! 1000th commit, I know this specific commit is super small, but the number of total commits is a large milestone. --- src/misc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/misc.rs b/src/misc.rs index 0caf9cd..d0c7500 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -58,7 +58,8 @@ pub fn newtons_method_helper( .tuple_windows() .filter(|(prev, curr)| prev.y.is_finite() && curr.y.is_finite()) .filter(|(prev, curr)| prev.y.signum() != curr.y.signum()) - .map(|(start, _)| newtons_method(f, f_1, start.x, range, threshold)) + .map(|(start, _)| start.x) + .map(|x| newtons_method(f, f_1, x, range, threshold)) .filter(|x| x.is_some()) .map(|x| unsafe { x.unwrap_unchecked() }) .collect()