Math & logic#
Elementwise numeric, trigonometric, activation, and boolean operations.
Arithmetic#
Elementwise numeric operations: rounding, powers, logs, exponentials, affine transforms, sign, and special functions.
Function |
Description |
|---|---|
Absolute value of each element. |
|
Elementwise sum of two aligned streams (x + y). |
|
Round each element toward positive infinity. |
|
Bound each element below and/or above. |
|
x cubed (faster than Power(3)). |
|
Elementwise quotient of two aligned streams (x / y). |
|
Gauss error function. |
|
Complementary error function (1 - erf). |
|
e to the power of each element. |
|
Round each element toward negative infinity. |
|
Pass-through (y = x). |
|
Affine transform: scale * x + shift. |
|
Two-input affine combination: a*x + b*y + c. |
|
Natural logarithm of each element. |
|
Elementwise product of two aligned streams (x * y). |
|
Negative part of x: max(-x, 0). |
|
Positive part of x: max(x, 0). |
|
x raised to a fixed exponent p. |
|
Round each element to the nearest integer (half-to-even). |
|
Sign of each element: -1, 0, or +1. |
|
Square root of each element. |
|
x squared (faster than Power(2)). |
|
Elementwise difference of two aligned streams (x - y). |
Trigonometry & geometry#
Angles, inverse trigonometric functions, coordinate conversions, and distances.
Function |
Description |
|---|---|
Inverse cosine of each element (radians, input in [-1, 1]). |
|
Inverse sine of each element (radians, input in [-1, 1]). |
|
Inverse tangent of each element (radians). |
|
Signed angle of (x, y) from the positive x-axis (numpy.arctan2 order). |
|
Convert (x, y) to (r, theta). |
|
Cosine of each element (radians). |
|
Euclidean distance sqrt(x^2 + y^2), numerically stable. |
|
Convert (r, theta) to (x, y). |
|
Sine of each element (radians). |
|
Hyperbolic tangent. |
Activations#
Neural-network activation functions.
Logic & comparison#
Boolean masks, comparisons, and conditional selection. Outputs are 1.0 (true) or 0.0 (false).
Function |
Description |
|---|---|
Returns 1.0 if both inputs are nonzero, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 if a == b, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 if a >= b, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 if a > b, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 for finite values, 0.0 for NaN or inf. Does not propagate NaN. |
|
Returns 1.0 if the input is NaN, else 0.0. Does not propagate NaN. |
|
Returns 1.0 if a <= b, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 if a < b, else 0.0. NaN in either input yields NaN. |
|
Returns 0.0 if input is nonzero, 1.0 if zero. NaN propagates. |
|
Returns 1.0 if a != b, else 0.0. NaN in either input yields NaN. |
|
Returns 1.0 if either input is nonzero, else 0.0. NaN in either input yields NaN. |
|
Returns a if mask is nonzero, b otherwise. NaN mask yields NaN. |