Mathematical functions

Trigonometric functions

dpnp.sin

Computes sine for each element x_i of input array x.

dpnp.cos

Computes cosine for each element x_i for input array x.

dpnp.tan

Computes tangent for each element x_i for input array x.

dpnp.arcsin

Computes inverse sine for each element x_i for input array x.

dpnp.asin

Computes inverse sine for each element x_i for input array x.

dpnp.arccos

Computes inverse cosine for each element x_i for input array x.

dpnp.acos

Computes inverse cosine for each element x_i for input array x.

dpnp.arctan

Computes inverse tangent for each element x_i for input array x.

dpnp.atan

Computes inverse tangent for each element x_i for input array x.

dpnp.hypot

Calculates the hypotenuse for a right triangle with "legs" x1_i and x2_i of input arrays x1 and x2.

dpnp.arctan2

Calculates the inverse tangent of the quotient x1_i/x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.atan2

Calculates the inverse tangent of the quotient x1_i/x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.degrees

Convert angles from radians to degrees.

dpnp.radians

Convert angles from degrees to radians.

dpnp.unwrap

Unwrap by taking the complement of large deltas with respect to the period.

dpnp.deg2rad

Convert angles from degrees to radians.

dpnp.rad2deg

Convert angles from radians to degrees.

dpnp.reduce_hypot

Calculates the square root of the sum of squares of elements in the input array.

Hyperbolic functions

dpnp.sinh

Computes hyperbolic sine for each element x_i for input array x.

dpnp.cosh

Computes hyperbolic cosine for each element x_i for input array x.

dpnp.tanh

Computes hyperbolic tangent for each element x_i for input array x.

dpnp.arcsinh

Computes inverse hyperbolic sine for each element x_i for input array x.

dpnp.asinh

Computes inverse hyperbolic sine for each element x_i for input array x.

dpnp.arccosh

Computes inverse hyperbolic cosine for each element x_i for input array x.

dpnp.acosh

Computes inverse hyperbolic cosine for each element x_i for input array x.

dpnp.arctanh

Computes hyperbolic inverse tangent for each element x_i for input array x.

dpnp.atanh

Computes hyperbolic inverse tangent for each element x_i for input array x.

Rounding

dpnp.round

Rounds each element x_i of the input array x to the nearest integer-valued number.

dpnp.around

Round an array to the given number of decimals.

dpnp.rint

Rounds each element x_i of the input array x to the nearest integer-valued number.

dpnp.fix

Round to nearest integer towards zero.

dpnp.floor

Returns the floor for each element x_i for input array x.

dpnp.ceil

Returns the ceiling for each element x_i for input array x.

dpnp.trunc

Returns the truncated value for each element x_i for input array x.

Sums, products, differences

dpnp.prod

Return the product of array elements over a given axis.

dpnp.sum

Sum of array elements over a given axis.

dpnp.nanprod

Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones.

dpnp.nansum

Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.

dpnp.cumulative_sum

Return the cumulative sum of the elements along a given axis.

dpnp.cumulative_prod

Return the cumulative product of elements along a given axis.

dpnp.cumprod

Return the cumulative product of elements along a given axis.

dpnp.cumsum

Return the cumulative sum of the elements along a given axis.

dpnp.nancumprod

Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as zero.

dpnp.nancumsum

Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.

dpnp.diff

Calculate the n-th discrete difference along the given axis.

dpnp.ediff1d

The differences between consecutive elements of an array.

dpnp.gradient

Return the gradient of an N-dimensional array.

dpnp.cross

Return the cross product of two (arrays of) vectors.

dpnp.trapezoid

Integrate along the given axis using the composite trapezoidal rule.

Exponents and logarithms

dpnp.exp

Computes the exponent for each element x_i of input array x.

dpnp.expm1

Computes the exponent minus 1 for each element x_i of input array x.

dpnp.exp2

Computes the base-2 exponent for each element x_i for input array x.

dpnp.log

Computes the natural logarithm for each element x_i of input array x.

dpnp.log10

Computes the base-10 logarithm for each element x_i of input array x.

dpnp.log2

Computes the base-2 logarithm for each element x_i of input array x.

dpnp.log1p

Computes the natural logarithm of (1 + x) for each element x_i of input array x.

dpnp.logaddexp

Calculates the natural logarithm of the sum of exponents for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.logaddexp2

Calculates the logarithm of the sum of exponents in base-2 for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.logsumexp

Calculates the logarithm of the sum of exponents of elements in the input array.

dpnp.cumlogsumexp

Calculates the cumulative logarithm of the sum of elements in the input array x.

Other special functions

dpnp.i0

Modified Bessel function of the first kind, order 0.

dpnp.sinc

Return the normalized sinc function.

Floating point routines

dpnp.signbit

Computes an indication of whether the sign bit of each element x_i of input array x is set.

dpnp.copysign

Composes a floating-point value with the magnitude of x1_i and the sign of x2_i for each element of input arrays x1 and x2.

dpnp.ldexp

Returns x1 * 2**x2, element-wise.

dpnp.nextafter

Return the next floating-point value after x1 towards x2, element-wise.

dpnp.spacing

Return the distance between x and the nearest adjacent number.

Rational routines

dpnp.lcm

Returns the lowest common multiple of |x1| and |x2|.

dpnp.gcd

Returns the greatest common divisor of |x1| and |x2|.

Arithmetic operations

dpnp.add

Calculates the sum for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.reciprocal

Computes the reciprocal square-root for each element x_i for input array x.

dpnp.positive

Computes the numerical positive for each element x_i of input array x.

dpnp.negative

Computes the numerical negative for each element x_i of input array x.

dpnp.multiply

Calculates the product for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.divide

Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.power

Calculates x1_i raised to x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.pow

Calculates x1_i raised to x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.subtract

Calculates the difference between each element x1_i of the input array x1 and the respective element x2_i of the input array x2.

dpnp.true_divide

Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.floor_divide

Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2 to the greatest integer-value number that is not greater than the division result.

dpnp.float_power

Calculates x1_i raised to x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.fmod

Calculates the remainder of division for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.mod

Calculates the remainder of division for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

dpnp.modf

Return the fractional and integral parts of an array, element-wise.

dpnp.remainder

Calculates the remainder of division for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

Handling complex numbers

dpnp.angle

Computes the phase angle (also called the argument) of each element x_i for input array x.

dpnp.real

Computes real part of each element x_i for input array x.

dpnp.imag

Computes imaginary part of each element x_i for input array x.

dpnp.conj

Computes conjugate of each element x_i for input array x.

dpnp.conjugate

Computes conjugate of each element x_i for input array x.

dpnp.proj

Computes projection of each element x_i for input array x.

Extrema finding

dpnp.maximum

Compares two input arrays x1 and x2 and returns a new array containing the element-wise maxima.

dpnp.max

Return the maximum of an array or maximum along an axis.

dpnp.amax

Return the maximum of an array or maximum along an axis.

dpnp.fmax

Compares two input arrays x1 and x2 and returns a new array containing the element-wise maxima.

dpnp.nanmax

Return the maximum of an array or maximum along an axis, ignoring any NaNs.

dpnp.minimum

Compares two input arrays x1 and x2 and returns a new array containing the element-wise minima.

dpnp.min

Return the minimum of an array or maximum along an axis.

dpnp.amin

Return the minimum of an array or minimum along an axis.

dpnp.fmin

Compares two input arrays x1 and x2 and returns a new array containing the element-wise minima.

dpnp.nanmin

Return the minimum of an array or minimum along an axis, ignoring any NaNs.

Miscellaneous

dpnp.convolve

Returns the discrete, linear convolution of two one-dimensional sequences.

dpnp.clip

Clip (limit) the values in an array.

dpnp.sqrt

Computes the positive square-root for each element x_i of input array x.

dpnp.cbrt

Computes positive cube-root for each element x_i for input array x.

dpnp.square

Squares each element x_i of input array x.

dpnp.rsqrt

Computes the reciprocal square-root for each element x_i for input array x.

dpnp.abs

Calculates the absolute value for each element x_i of input array x.

dpnp.absolute

Calculates the absolute value for each element x_i of input array x.

dpnp.fabs

Compute the absolute values element-wise.

dpnp.sign

Computes an indication of the sign of each element x_i of input array x using the signum function.

dpnp.heaviside

Compute the Heaviside step function.

dpnp.nan_to_num

Replace NaN with zero and infinity with large finite numbers (default behavior) or with the numbers defined by the user using the nan, posinf and/or neginf keywords.

dpnp.real_if_close

If input is complex with all imaginary parts close to zero, return real parts.