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.
This commit is contained in:
parent
789286d23f
commit
e3128593e2
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user