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