Sleef

Trait Sleef 

Source
pub trait Sleef: Sized {
    type Int;

Show 51 methods // Required methods fn sin(self) -> Self; fn cos(self) -> Self; fn sin_cos(self) -> (Self, Self); fn tan(self) -> Self; fn asin(self) -> Self; fn acos(self) -> Self; fn atan(self) -> Self; fn atan2(self, other: Self) -> Self; fn ln(self) -> Self; fn cbrt(self) -> Self; fn exp(self) -> Self; fn pow(self, other: Self) -> Self; fn sinh(self) -> Self; fn cosh(self) -> Self; fn tanh(self) -> Self; fn asinh(self) -> Self; fn acosh(self) -> Self; fn atanh(self) -> Self; fn exp2(self) -> Self; fn exp10(self) -> Self; fn exp_m1(self) -> Self; fn log10(self) -> Self; fn log2(self) -> Self; fn log_1p(self) -> Self; fn ldexp(self, other: Self::Int) -> Self; fn ilogb(self) -> Self::Int; fn fma(self, y: Self, z: Self) -> Self; fn sqrt(self) -> Self; fn abs(self) -> Self; fn copy_sign(self, other: Self) -> Self; fn max(self, other: Self) -> Self; fn min(self, other: Self) -> Self; fn fdim(self, other: Self) -> Self; fn truncate(self) -> Self; fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn next_after(self, other: Self) -> Self; fn frfrexp(self) -> Self; fn expfrexp(self) -> Self::Int; fn fmod(self, other: Self) -> Self; fn remainder(self, other: Self) -> Self; fn modf(self) -> (Self, Self); fn sin_cos_pi(self) -> (Self, Self); fn sin_pi(self) -> Self; fn cos_pi(self) -> Self; fn hypot(self, other: Self) -> Self; fn gamma(self) -> Self; fn lgamma(self) -> Self; fn erf(self) -> Self; fn erfc(self) -> Self;
}
Expand description

Generic trait for floating point & SIMD numbers

Required Associated Types§

Source

type Int

Signed integer type or SIMD vector of integers

Required Methods§

Source

fn sin(self) -> Self

Sine function

Source

fn cos(self) -> Self

Cosine function

Source

fn sin_cos(self) -> (Self, Self)

Evaluate sine and cosine functions simultaneously

Source

fn tan(self) -> Self

Tangent function

Source

fn asin(self) -> Self

Arc sine function

Source

fn acos(self) -> Self

Arc cosine function

Source

fn atan(self) -> Self

Arc tangent function

Source

fn atan2(self, other: Self) -> Self

Arc tangent function of two variables

Source

fn ln(self) -> Self

Natural logarithmic function

Source

fn cbrt(self) -> Self

Cube root function

Source

fn exp(self) -> Self

Base-e exponential function

Source

fn pow(self, other: Self) -> Self

Power function

Source

fn sinh(self) -> Self

Hyperbolic sine function

Source

fn cosh(self) -> Self

Hyperbolic cosine function

Source

fn tanh(self) -> Self

Hyperbolic tangent function

Source

fn asinh(self) -> Self

Inverse hyperbolic sine function

Source

fn acosh(self) -> Self

Inverse hyperbolic cosine function

Source

fn atanh(self) -> Self

Inverse hyperbolic tangent function

Source

fn exp2(self) -> Self

Base-2 exponential function

Source

fn exp10(self) -> Self

Base-10 exponential function

Source

fn exp_m1(self) -> Self

Base-e exponential function minus 1

Source

fn log10(self) -> Self

Base-10 logarithmic function

Source

fn log2(self) -> Self

Base-2 logarithmic function

Source

fn log_1p(self) -> Self

Logarithm of one plus argument

Source

fn ldexp(self, other: Self::Int) -> Self

Multiply by integral power of 2

Source

fn ilogb(self) -> Self::Int

Integer exponent of an FP number

Source

fn fma(self, y: Self, z: Self) -> Self

Fused multiply and accumulate

Source

fn sqrt(self) -> Self

Square root function

Source

fn abs(self) -> Self

Absolute value

Source

fn copy_sign(self, other: Self) -> Self

Copy sign of a number

Source

fn max(self, other: Self) -> Self

Maximum of two numbers

Source

fn min(self, other: Self) -> Self

Minimum of two numbers

Source

fn fdim(self, other: Self) -> Self

Positive difference

Source

fn truncate(self) -> Self

Round to integer towards zero

Source

fn floor(self) -> Self

Round to integer towards minus infinity

Source

fn ceil(self) -> Self

Round to integer towards plus infinity

Source

fn round(self) -> Self

Round to integer, ties round to even

Source

fn next_after(self, other: Self) -> Self

Find the next representable FP value

Source

fn frfrexp(self) -> Self

Fractional component of an FP number

Source

fn expfrexp(self) -> Self::Int

Exponent of an FP number

Source

fn fmod(self, other: Self) -> Self

FP remainder

Source

fn remainder(self, other: Self) -> Self

FP remainder

Source

fn modf(self) -> (Self, Self)

Integral and fractional value of FP number

Source

fn sin_cos_pi(self) -> (Self, Self)

Evaluate sin( πa ) and cos( πa ) for given a simultaneously

Source

fn sin_pi(self) -> Self

Evaluate sin( πa ) for given a

Source

fn cos_pi(self) -> Self

Evaluate cos( πa ) for given a

Source

fn hypot(self, other: Self) -> Self

2D Euclidian distance function

Source

fn gamma(self) -> Self

Gamma function

Source

fn lgamma(self) -> Self

Log gamma function

Source

fn erf(self) -> Self

Error function

Source

fn erfc(self) -> Self

Complementary error function

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Sleef for f32

Source§

type Int = i32

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn ln(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn pow(self, other: Self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn asinh(self) -> Self

Source§

fn acosh(self) -> Self

Source§

fn atanh(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp10(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log_1p(self) -> Self

Source§

fn ldexp(self, other: Self::Int) -> Self

Source§

fn ilogb(self) -> Self::Int

Source§

fn fma(self, y: Self, z: Self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn copy_sign(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn fdim(self, other: Self) -> Self

Source§

fn truncate(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn next_after(self, other: Self) -> Self

Source§

fn frfrexp(self) -> Self

Source§

fn expfrexp(self) -> Self::Int

Source§

fn fmod(self, other: Self) -> Self

Source§

fn remainder(self, other: Self) -> Self

Source§

fn modf(self) -> (Self, Self)

Source§

fn sin_cos_pi(self) -> (Self, Self)

Source§

fn sin_pi(self) -> Self

Source§

fn cos_pi(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn gamma(self) -> Self

Source§

fn lgamma(self) -> Self

Source§

fn erf(self) -> Self

Source§

fn erfc(self) -> Self

Source§

impl Sleef for f64

Source§

type Int = i32

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn ln(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn pow(self, other: Self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn asinh(self) -> Self

Source§

fn acosh(self) -> Self

Source§

fn atanh(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp10(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log_1p(self) -> Self

Source§

fn ldexp(self, other: Self::Int) -> Self

Source§

fn ilogb(self) -> Self::Int

Source§

fn fma(self, y: Self, z: Self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn copy_sign(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn fdim(self, other: Self) -> Self

Source§

fn truncate(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn next_after(self, other: Self) -> Self

Source§

fn frfrexp(self) -> Self

Source§

fn expfrexp(self) -> Self::Int

Source§

fn fmod(self, other: Self) -> Self

Source§

fn remainder(self, other: Self) -> Self

Source§

fn modf(self) -> (Self, Self)

Source§

fn sin_cos_pi(self) -> (Self, Self)

Source§

fn sin_pi(self) -> Self

Source§

fn cos_pi(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn gamma(self) -> Self

Source§

fn lgamma(self) -> Self

Source§

fn erf(self) -> Self

Source§

fn erfc(self) -> Self

Source§

impl<const N: usize> Sleef for Simd<f32, N>

Source§

type Int = Simd<i32, N>

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn ln(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn pow(self, other: Self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn asinh(self) -> Self

Source§

fn acosh(self) -> Self

Source§

fn atanh(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp10(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log_1p(self) -> Self

Source§

fn ldexp(self, other: Self::Int) -> Self

Source§

fn ilogb(self) -> Self::Int

Source§

fn fma(self, y: Self, z: Self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn copy_sign(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn fdim(self, other: Self) -> Self

Source§

fn truncate(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn next_after(self, other: Self) -> Self

Source§

fn frfrexp(self) -> Self

Source§

fn expfrexp(self) -> Self::Int

Source§

fn fmod(self, other: Self) -> Self

Source§

fn remainder(self, other: Self) -> Self

Source§

fn modf(self) -> (Self, Self)

Source§

fn sin_cos_pi(self) -> (Self, Self)

Source§

fn sin_pi(self) -> Self

Source§

fn cos_pi(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn gamma(self) -> Self

Source§

fn lgamma(self) -> Self

Source§

fn erf(self) -> Self

Source§

fn erfc(self) -> Self

Source§

impl<const N: usize> Sleef for Simd<f64, N>

Source§

type Int = Simd<i32, N>

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn ln(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn pow(self, other: Self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn asinh(self) -> Self

Source§

fn acosh(self) -> Self

Source§

fn atanh(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp10(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log_1p(self) -> Self

Source§

fn ldexp(self, other: Self::Int) -> Self

Source§

fn ilogb(self) -> Self::Int

Source§

fn fma(self, y: Self, z: Self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn copy_sign(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn fdim(self, other: Self) -> Self

Source§

fn truncate(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn next_after(self, other: Self) -> Self

Source§

fn frfrexp(self) -> Self

Source§

fn expfrexp(self) -> Self::Int

Source§

fn fmod(self, other: Self) -> Self

Source§

fn remainder(self, other: Self) -> Self

Source§

fn modf(self) -> (Self, Self)

Source§

fn sin_cos_pi(self) -> (Self, Self)

Source§

fn sin_pi(self) -> Self

Source§

fn cos_pi(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn gamma(self) -> Self

Source§

fn lgamma(self) -> Self

Source§

fn erf(self) -> Self

Source§

fn erfc(self) -> Self

Implementors§