Skip to main content

feanor_math/algorithms/fft/
complex_fft.rs

1/// The absolute error in the expression `exp(2 * pi * i * (x / y))`.
2#[stability::unstable(feature = "enable")]
3pub fn root_of_unity_error() -> f64 { 6.0 * f64::EPSILON }
4
5/// Trait for operations that perform float-point computations, and thus must
6/// care about precision. Currently only used for [`crate::algorithms::fft::FFTAlgorithm`].
7#[stability::unstable(feature = "enable")]
8pub trait FFTErrorEstimate {
9    /// This is only true if the table is created with the
10    /// [`crate::rings::float_complex::Complex64`]-specific creator functions. Note that this is
11    /// a worst-case estimate and likely to significantly overestimate the error.
12    ///
13    /// This estimates the error from [`crate::algorithms::fft::FFTAlgorithm::unordered_fft()`]. The
14    /// error during the inverse FFT is the same, but will be scaled by `1/n`.
15    fn expected_absolute_error(&self, input_bound: f64, input_error: f64) -> f64;
16}