fix build and add test for newtons_method

This commit is contained in:
Simon Gardling
2022-05-18 14:52:03 -04:00
parent db68d5e23a
commit e7e82a72b2
4 changed files with 21 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ pub use crate::{
// decimal_round,
hashed_storage_create,
hashed_storage_read,
newtons_method,
option_vec_printer,
step_helper,
EguiHelper,

View File

@@ -247,7 +247,7 @@ pub fn newtons_method_helper(
/// `f` is f(x)
/// `f_1` is f'(x) aka the derivative of f(x)
/// The function returns an `Option<f64>` of the x value at which a root occurs
fn newtons_method(
pub fn newtons_method(
f: &dyn Fn(f64) -> f64, f_1: &dyn Fn(f64) -> f64, start_x: &f64, range: &std::ops::Range<f64>,
threshold: &f64,
) -> Option<f64> {