pub trait Float {
fn sin_deg_fast(self) -> Self;
fn sin_rad_fast(self) -> Self;
fn cos_deg_fast(self) -> Self;
fn cos_rad_fast(self) -> Self;
fn atan2_fast(self, x: f32) -> Self;
fn inv_sqrt(self) -> Self;
fn perceptual(self) -> Self;
}
Expand description
Extra functions on floating point values.
Required Methods
fn sin_deg_fast(self) -> Self
fn sin_deg_fast(self) -> Self
Computes the sine of a number. Input in degrees, output in radians.
- Average error of 0.00060 radians.
- Largest error of 0.00229 radians.
- Speedup of 30x over f32.sin();
fn sin_rad_fast(self) -> Self
fn sin_rad_fast(self) -> Self
Computes the sine of a number. Input in radians, output in radians.
- Average error of 0.00060 radians.
- Largest error of 0.00229 radians.
- Speedup of 30x over f32.sin();
fn cos_deg_fast(self) -> Self
fn cos_deg_fast(self) -> Self
Computes the cosine of a number. Input in degrees, output in radians.
- Average error of 0.00060 radians.
- Largest error of 0.00229 radians.
- Speedup of 30x over f32.cos();
fn cos_rad_fast(self) -> Self
fn cos_rad_fast(self) -> Self
Computes the cosine of a number. Input in radians, output in radians.
- Average error of 0.00060 radians.
- Largest error of 0.00229 radians.
- Speedup of 30x over f32.cos();
fn atan2_fast(self, x: f32) -> Self
fn atan2_fast(self, x: f32) -> Self
Computes the four quadrant arctangent of self (y) and other (x) in radians.
- Average error of 0.00231 radians.
- Largest error of 0.00488 radians.
- Speedup of 20.67x over f32.atan2(y);
fn perceptual(self) -> Self
fn perceptual(self) -> Self
Converts perceptual (db) into linear ([0, 1]).