←back to thread

125 points mtantaoui | 3 comments | | HN request time: 0.631s | source

Integrate is a fast, small, lightweight Rust library for performing numerical integration of real-valued functions. It is designed to integrate functions, providing a simple and efficient way to approximate definite integrals using various numerical methods.

Integrate supports a variety of numerical integration techniques: - Newton-Cotes methods:

  - Rectangle Rule.
  - Trapezoidal Rule.
  - Simpson's Rule.
  - Newton's 3/8 Rule.
- Gauss quadrature methods:

  - Gauss-Legendre.
  - Gauss-Laguerre.
  - Gauss-Hermite.
  - Gauss-Chebyshev First Kind.
  - Gauss-Chebyshev Second Kind.
- Adaptive Methods:

  - Adaptive Simpson's method
- Romberg’s method.
1. legobmw99 ◴[] No.42188015[source]
Is there a technical reason to now allow closures as the integrand?
replies(1): >>42188132 #
2. n_plus_1_acc ◴[] No.42188132[source]
Mayve because they aren't guaranteed to be actual functions (in the mathematical sense) and could return random values
replies(1): >>42188173 #
3. legobmw99 ◴[] No.42188173[source]
The Fn trait could be used, which prevents mutation, but allows a lot of useful closures. I should note, a motivated user could provide a junk function no matter what the type accepted is