module
math
Defines math utilities.
You can import these APIs from the math
package. For example:
from math import mul
Functions
-
mod
: Performs elementwise modulo operation of two SIMD vectors. -
mul
: Performs elementwise multiplication of two SIMD vectors. -
sub
: Performs elementwise subtraction of two SIMD vectors. -
add
: Performs elementwise addition of two SIMD vectors. -
div
: Performs elementwise division of two SIMD vectors. -
clamp
: Clamps the values in a SIMD vector to be in a certain range. -
abs
: Gets the absolute value of an integer. -
rotate_bits_left
: Shifts the bits of a input to the left byshift
bits (with wrap-around). -
rotate_bits_right
: Shifts the bits of an input to the left byshift
bits (with wrap-around). -
rotate_left
: Shifts the bits of a input to the left byshift
bits (with wrap-around). -
rotate_right
: Shifts the bits of a input to the right byshift
bits (with wrap-around). -
floor
: Performs elementwise floor on the elements of a SIMD vector. -
ceil
: Performs elementwise ceiling on the elements of a SIMD vector. -
ceildiv
: Return the rounded-up result of dividing x by y. -
trunc
: Performs elementwise truncation on the elements of a SIMD vector. -
round
: Performs elementwise rounding on the elements of a SIMD vector. -
roundeven
: Performs elementwise banker's rounding on the elements of a SIMD vector. -
round_half_down
: Rounds ties towards the smaller integer". -
round_half_up
: Rounds ties towards the larger integer". -
sqrt
: Performs square root on an integer. -
rsqrt
: Performs elementwise reciprocal square root on the elements of a SIMD vector. -
exp2
: Computes elementwise 2 raised to the power of n, where n is an element of the input SIMD vector. -
ldexp
: Computes elementwise ldexp function. -
exp
: Calculates elementwise exponential of the input vector. -
frexp
: Breaks floating point values into a fractional part and an exponent part. -
log
: Performs elementwise natural log (base E) of a SIMD vector. -
log2
: Performs elementwise log (base 2) of a SIMD vector. -
copysign
: Returns a value with the magnitude of the first operand and the sign of the second operand. -
erf
: Performs the elementwise Erf on a SIMD vector. -
tanh
: Performs elementwise evaluation of the tanh function. -
isclose
: Checks if the two input values are numerically within a tolerance. -
all_true
: Returns True if all elements in the SIMD vector are True and False otherwise. -
any_true
: Returns True if any elements in the SIMD vector is True and False otherwise. -
none_true
: Returns True if all element in the SIMD vector are False and False otherwise. -
reduce_bit_count
: Returns a scalar containing total number of bits set in given vector. -
iota
: Creates a SIMD vector containing an increasing sequence, starting from 0. -
is_power_of_2
: Performs elementwise check of whether SIMD vector contains integer powers of two. -
is_odd
: Performs elementwise check of whether an integer value is odd. -
is_even
: Performs elementwise check of whether an integer value is even. -
fma
: Performsfma
(fused multiply-add) on the inputs. -
reciprocal
: Takes the elementwise reciprocal of a SIMD vector. -
identity
: Gets the identity of a SIMD vector. -
greater
: Performs elementwise check of whether values in x are greater than values in y. -
greater_equal
: Performs elementwise check of whether values in x are greater than or equal to values in y. -
less
: Performs elementwise check of whether values in x are less than values in y. -
less_equal
: Performs elementwise check of whether values in x are less than or equal to values in y. -
equal
: Performs elementwise check of whether values in x are equal to values in y. -
logical_and
: Performs elementwise logical And operation. -
logical_not
: Performs elementwise logical Not operation. -
logical_xor
: Performs elementwise logical Xor operation. -
not_equal
: Performs elementwise check of whether values in x are not equal to values in y. -
select
: Selects the values of the true_case or the false_case based on the input boolean values of the given SIMD vector. -
max
: Gets the maximum of two integers. -
min
: Gets the minimum of two integers. -
pow
: Computes thepow
of the inputs. -
div_ceil
: Divides an integer by another integer, and round up to the nearest integer. -
align_down
: Returns the closest multiple of alignment that is less than or equal to value. -
align_down_residual
: Returns the remainder after aligning down value to alignment. -
align_up
: Returns the closest multiple of alignment that is greater than or equal to value. -
acos
: Computes theacos
of the inputs. -
asin
: Computes theasin
of the inputs. -
atan
: Computes theatan
of the inputs. -
atan2
: Computes theatan2
of the inputs. -
cos
: Computes thecos
of the inputs. -
sin
: Computes thesin
of the inputs. -
tan
: Computes thetan
of the inputs. -
acosh
: Computes theacosh
of the inputs. -
asinh
: Computes theasinh
of the inputs. -
atanh
: Computes theatanh
of the inputs. -
cosh
: Computes thecosh
of the inputs. -
sinh
: Computes thesinh
of the inputs. -
expm1
: Computes theexpm1
of the inputs. -
log10
: Computes thelog10
of the inputs. -
log1p
: Computes thelog1p
of the inputs. -
logb
: Computes thelogb
of the inputs. -
cbrt
: Computes thecbrt
of the inputs. -
hypot
: Computes thehypot
of the inputs. -
erfc
: Computes theerfc
of the inputs. -
lgamma
: Computes thelgamma
of the inputs. -
tgamma
: Computes thetgamma
of the inputs. -
nearbyint
: Computes thenearbyint
of the inputs. -
rint
: Computes therint
of the inputs. -
remainder
: Computes theremainder
of the inputs. -
nextafter
: Computes thenextafter
of the inputs. -
j0
: Computes the Bessel function of the first kind of order 0 for each input value. -
j1
: Computes the Bessel function of the first kind of order 1 for each input value. -
y0
: Computes the Bessel function of the second kind of order 0 for each input value. -
y1
: Computes the Bessel function of the second kind of order 1 for each input value. -
scalb
: Computes thescalb
of the inputs. -
gcd
: Computes the greatest common divisor of two integers. -
lcm
: Computes the least common multiple of two integers. -
factorial
: Computes the factorial of the integer. -
nan
: Gets a NaN value for the given dtype. -
isnan
: Checks if the value is Not a Number (NaN). -
isinf
: Checks if the value is infinite. -
isfinite
: Checks if the value is not infinite. -
divmod
: Computes both the quotient and remainder using integer division. -
ulp
: Computes the ULP (units of last place) or (units of least precision) of the number.