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

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();

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();

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();

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();

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);

Quake fast inverse square root.

Converts perceptual (db) into linear ([0, 1]).

Implementations on Foreign Types

Implementors