fnir 0.1.0

Fast numerical integration rules, like tanh-sinh quadrature
Documentation
  • Coverage
  • 50.88%
    29 out of 57 items documented0 out of 48 items with examples
  • Size
  • Source code size: 68.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TileHalo

Fast Numeric Integration in Rust (FNIR) build status

FNIR provides various numerical integration algorithms for use.

Usage

Add the following under [dependencies] in your cargo.toml

fnir = 0.1.0

To use for example the Michalski-Mosig variant of $\tanh\sinh$ quadrature include the following:

use fnir::{Integral, quadrature::{TanhSinh}};
...

let integrator = TanhSinh::new();
let func = |x: f64| f64::powi(x, 2);

let result = integrator.integrate(func, Some(0), Some(1)); // Ok(0.3333...)

WARNING: This project is in early stages and until 1.0.0 subject to breaking chances etc.

Use cases

This crate can be used to integrate integrals in the form $\int_a^b f(x) dx$ where $a, b \in \R$ and $f: \R \to B \subset \C$, semi-infinite integrals where either $a$ or $b$ is infinite and infinite intervals (both are infinite).

Currently used and planned quadratures are:

  • Trapezoidal rule
  • Michalski-Mosig $\tanh\sinh$
  • Michalski-Mosig $\exp\sinh$ (semi-infinite interval)
  • Michalski-Mosig $\sinh\sinh$ (infinite interval)

Planned future features include the following:

  • Complex contour integrals
  • Integrals over triangular surfaces
  • Element-wise integration of $N$-dimensional arrays

In some distant future the following would also be nice:

  • Vectorization (i.e. SIMD)
  • Generic parametrization

Contributing

Feel free to submit bug reports, feature requests, and the best of all, pull requests to those issues.