#interval #root #root-finding #methods #function #multivariate #univariate

rootfinder

Root-finding methods for both univariate, scalar-valued functions and multivariate, vector-valued functions

3 unstable releases

0.2.1 Dec 8, 2024
0.2.0 Dec 8, 2024
0.1.0 Nov 3, 2024

#343 in Math

Download history 118/week @ 2024-10-28 23/week @ 2024-11-04 4/week @ 2024-11-18 90/week @ 2024-12-02 149/week @ 2024-12-09

243 downloads per month

MIT/Apache

83KB
1.5K SLoC

rootfinder

github crates.io docs.rs

Root-finding methods for both univariate, scalar-valued functions and multivariate, vector-valued functions.

Documentation

Please see https://docs.rs/rootfinder.

Example

use rootfinder::{root_bisection, Interval};

// Define the function f(x) = x² - 1.
let f = |x: f64| x.powi(2) - 1.0;

// We want the root in the interval [0,∞). Therefore, we use an initial interval of
// [a,b] = [0,9999999]. Finding this root using the bisection method,
let result = root_bisection(&f, Interval::new(0.0, 9999999.0), None, None);
let root = result.unwrap();

// `root` is `0.9999999999999999`, which is very close to the true root of 1.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~47KB