←back to thread

123 points mtantaoui | 2 comments | | HN request time: 0.416s | 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.
Show context
legobmw99 ◴[] No.42188015[source]
Is there a technical reason to now allow closures as the integrand?
replies(1): >>42188132 #
1. 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 #
2. 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