←back to thread

125 points mtantaoui | 4 comments | | HN request time: 0.607s | 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. zackangelo ◴[] No.42187535[source]
> Does the function oscillate over the region of integration? If it does, then make sure that the step size is chosen to be smaller than the wave length of the function.

Nyquist limit, but for numerical integration?

replies(3): >>42188927 #>>42189046 #>>42189391 #
2. im3w1l ◴[] No.42188927[source]
Well in both cases it comes down to aliasing I think (high frequency wave presents as low frequency wave with too big step size)
3. dawnofdusk ◴[] No.42189046[source]
The Nyquist sampling theorem is of course proved by considering a Fourier transform, which is given by an integral, so the relation to integration in general should not be surprising.
4. alleycat5000 ◴[] No.42189391[source]
One way to think about is that these techniques work by integrating exactly the polynomial that interpolates the function where you're sampling it, so you need to resolve the features of the function to get good accuracy.