root1d

Crates.ioroot1d
lib.rsroot1d
version0.4.0
sourcesrc
created_at2022-04-15 21:27:32.89135
updated_at2024-07-20 09:05:59.324057
descriptionOne dimensional root finding algorithms
homepagehttps://github.com/Chris00/rust-root1d
repositoryhttps://github.com/Chris00/rust-root1d
max_upload_size
id568709
size131,584
Galant Damien (damien-gal)

documentation

https://docs.rs/root1d

README

Find roots of functions of one variable

This crate provides algorithms over a generic type T to find roots of functions TT. It is readily usable for T being f64 and f32. Activating the feature rug, one can also use it with rug::Float and rug::Rational.

Usage

use root1d::toms748;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let root = toms748(|x| x*x - 2., 0., 2.).rtol(1e-10).root()?;
    println!("root: {}", root);
	Ok(())
}

For more information, consult the documentation of the latest release.

Highlights

  • Efficient & fully generic code.
  • Convenient interface with optional arguments and default termination criteria.
  • Support for non-copy types (for multi-precision numbers) minimizing the creation of temporary values.
  • State of the art root finding algorithm (Toms748) requiring only few evaluations of the function.
  • Compile with #![no_std] when declared with default-features = false.
Commit count: 122

cargo fmt