Expand description
The f32 slice entry points are also available as free functions here.
Functions§
- acos
- Arc cosine function; 1.0 ULP.
- acos_
u35 - Arc cosine function, 3.5 ULP tier.
- acosh
- Inverse hyperbolic cosine function; 1.0 ULP.
- asin
- Arc sine function; 1.0 ULP.
- asin_
u35 - Arc sine function, 3.5 ULP tier.
- asinh
- Inverse hyperbolic sine function; 1.0 ULP.
- atan
- Arc tangent function; 1.0 ULP.
- atan2
- Arc tangent of two arguments; 1.0 ULP.
- atan_
u35 - Arc tangent function, 3.5 ULP tier.
- atanh
- Inverse hyperbolic tangent function; 1.0 ULP.
- cbrt
- Cube root function; 1.0 ULP.
- cbrt_
u35 - Cube root, 3.5 ULP tier.
- cos
- Cosine function; 1.0 ULP.
- cos_
deterministic - Cosine, bitwise identical across lanes and platforms; 1.0 ULP.
- cos_
deterministic_ u35 - Cosine, lane-order independent, 3.5 ULP tier.
- cos_u35
- Cosine function, 3.5 ULP tier.
- cosh
- Hyperbolic cosine function; 1.0 ULP.
- cosh_
u35 - Hyperbolic cosine, 3.5 ULP tier.
- cospi
- Cosine of
pi * x;0.506 ULP. - erf
- Error function; 1.0 ULP.
- erfc
- Complementary error function;
max(1.5, 2.5) ULP. - exp
- Natural exponential function; 1.0 ULP.
- exp2
- Base-2 exponential function; 1.0 ULP.
- exp2_
u35 - Base-2 exponential, 3.5 ULP tier.
- exp10
- Base-10 exponential function; 1.09 ULP.
- exp10_
u35 - Base-10 exponential, 3.5 ULP tier.
- expm1
- Natural exponential function minus one; 1.0 ULP.
- gelu
- Exact-form GELU
x/2 * (1 + erf(x / sqrt(2)))in one pass. See the kernel (crate::f32x::activation::gelu/crate::f64x::activation::gelu) for the error bound: thef32kernel evaluateserfas PyTorch’s CPU GELU does (absolute error about5e-7onerfafter rounding, so3.0e-7 * |x|plus 3 ULP on the result), thef64kernel uses the 1.0 ULPerf. - gelu_
tanh - GELU tanh approximation
x/2 * (1 + tanh(sqrt(2/pi) * (x + 0.044715 x^3)))in one pass; 3.0 ULP forx >= 0, see the kernel forx < 0. - hypot
- Euclidean distance in two dimensions;
0.5001 ULP. - i0e
- Exponentially scaled modified Bessel function
exp(-|x|) I0(x); never overflows. Bound: see the kernel. - i1e
- Exponentially scaled modified Bessel function
exp(-|x|) I1(x); never overflows, odd inx. Bound: see the kernel. - lgamma
- Logarithm of the absolute gamma function; 1.0 ULP.
- log
- Natural logarithm; 1.0 ULP.
- log2
- Base-2 logarithm; 1.0 ULP.
- log1p
- Logarithm of one plus the argument; 1.0 ULP.
- log2_
u35 - Base-2 logarithm, 3.5 ULP tier.
- log10
- Base-10 logarithm; 1.0 ULP.
- log_u35
- Natural logarithm, 3.5 ULP tier.
- pow
- Argument raised to an argument power; 1.0 ULP.
- sigmoid
- Logistic sigmoid
1 / (1 + exp(-x))in one pass, overflow-free; 2.5 ULP. - silu
- SiLU / swish
x * sigmoid(x)in one pass; 3.5 ULP whereverexp(-|x|)is normal (see the kernel for the subnormal tail). - sin
- Sine function; 1.0 ULP.
- sin_
deterministic - Sine, bitwise identical across lanes and platforms; 1.0 ULP.
- sin_
deterministic_ u35 - Sine, lane-order independent, 3.5 ULP tier.
- sin_u35
- Sine function, 3.5 ULP tier.
- sincos
- Sine and cosine evaluated together; 1.0 ULP.
- sincos_
deterministic - Sine and cosine together, lane-order independent; 1.0 ULP.
- sincos_
deterministic_ u35 - Sine and cosine together, lane-order independent, 3.5 ULP tier.
- sincos_
u35 - Sine and cosine evaluated together, 3.5 ULP tier.
- sincospi
- Sine and cosine of
pi * xtogether;0.506 ULP. - sincospi_
u35 - Sine and cosine of
pi * xtogether, 3.5 ULP tier. - sinh
- Hyperbolic sine function; 1.0 ULP.
- sinh_
u35 - Hyperbolic sine, 3.5 ULP tier.
- sinpi
- Sine of
pi * x;0.506 ULP. - softplus
- Softplus
log(1 + exp(x))in one pass, overflow-free; 3.0 ULP. - sqrt
- Square root; 0.5 ULP.
- tan
- Tangent function; 1.0 ULP.
- tan_
deterministic - Tangent, bitwise identical across lanes and platforms; 1.0 ULP.
- tan_
deterministic_ u35 - Tangent, lane-order independent, 3.5 ULP tier.
- tan_u35
- Tangent function, 3.5 ULP tier.
- tanh
- Hyperbolic tangent function; 1.0 ULP.
- tanh_
u35 - Hyperbolic tangent, 3.5 ULP tier.
- tgamma
- Gamma function; 1.0 ULP.
- xlogy
x * ln(y), defined as0whenx == 0andyis not NaN (SciPy’sxlogy). Bound: see the kernel.