VM Mathematical Functions

VM Mathematical Functions

This section describes VM functions that compute values of mathematical functions on real and complex vector arguments with unit increment.

Each function is introduced by its short name, a brief description of its purpose, and the calling sequence for each type of data, as well as a description of the input/output arguments.

The input range of parameters is equal to the mathematical range of the input data type, unless the function description specifies input threshold values, which mark off the precision overflow, as follows:

  • FLT_MAX denotes the maximum number representable in single precision real data type

  • DBL_MAX denotes the maximum number representable in double precision real data type

The following tables list the available mathematical functions grouped by category.

Arithmetic Routines

Description

add

Adds vector elements

sub

Subtracts vector elements

sqr

Squares vector elements

mul

Multiplies vector elements

mulbyconj

Multiplies elements of one vector by conjugated elements of the second vector

conj

Conjugates vector elements

abs

Computes the absolute value of vector elements

arg

Computes the argument of vector elements

linearfrac

Performs linear fraction transformation of vectors

fmod

Performs element by element computation of the modulus function of vector a with respect to vector b

remainder

Performs element by element computation of the remainder function on the elements of vector a and the corresponding elements of vector b

Power and Root Routines

Description

inv

Inverts vector elements

div

Divides elements of one vector by elements of the second vector

sqrt

Computes the square root of vector elements

invsqrt

Computes the inverse square root of vector elements

cbrt

Computes the cube root of vector elements

invcbrt

Computes the inverse cube root of vector elements

pow2o3

Computes the cube root of the square of each vector element

pow3o2

Computes the square root of the cube of each vector element

pow

Raises each vector element to the specified power

powx

Raises each vector element to the constant power

powr

Computes a to the power b for elements of two vectors, where the elements of vector argument a are all non-negative

hypot

Computes the square root of sum of squares

Exponential and Logarithmic Routines

Description

exp

Computes the base e exponential of vector elements

exp2

Computes the base 2 exponential of vector elements

exp10

Computes the base 10 exponential of vector elements

expm1

Computes the base e exponential of vector elements decreased by 1

ln

Computes the natural logarithm of vector elements

log2

Computes the base 2 logarithm of vector elements

log10

Computes the base 10 logarithm of vector elements

log1p

Computes the natural logarithm of vector elements that are increased by 1

logb

Computes the exponents of the elements of input vector a

Trigonometric Routines

Description

cos

Computes the cosine of vector elements

sin

Computes the sine of vector elements

sincos

Computes the sine and cosine of vector elements

cis

Computes the complex exponent of vector elements (cosine and sine combined to complex value)

tan

Computes the tangent of vector elements

acos

Computes the inverse cosine of vector elements

asin

Computes the inverse sine of vector elements

atan

Computes the inverse tangent of vector elements

atan2

Computes the four-quadrant inverse tangent of ratios of the elements of two vectors

cospi

Computes the cosine of vector elements multiplied by π

sinpi

Computes the sine of vector elements multiplied by π

tanpi

Computes the tangent of vector elements multiplied by π

acospi

Computes the inverse cosine of vector elements divided by π

asinpi

Computes the inverse sine of vector elements divided by π

atanpi

Computes the inverse tangent of vector elements divided by π

atan2pi

Computes the four-quadrant inverse tangent of the ratios of the corresponding elements of two vectors divided by π

cosd

Computes the cosine of vector elements multiplied by π/180

sind

Computes the sine of vector elements multiplied by π/180

tand

Computes the tangent of vector elements multiplied by π/180

Hyperbolic Routines

Description

cosh

Computes the hyperbolic cosine of vector elements

sinh

Computes the hyperbolic sine of vector elements

tanh

Computes the hyperbolic tangent of vector elements

acosh

Computes the inverse hyperbolic cosine of vector elements

asinh

Computes the inverse hyperbolic sine of vector elements

atanh

Computes the inverse hyperbolic tangent of vector elements.

Special Routines

Description

erf

Computes the error function value of vector elements

erfc

Computes the complementary error function value of vector elements

cdfnorm

Computes the cumulative normal distribution function value of vector elements

erfinv

Computes the inverse error function value of vector elements

erfcinv

Computes the inverse complementary error function value of vector elements

cdfnorminv

Computes the inverse cumulative normal distribution function value of vector elements

lgamma

Computes the natural logarithm for the absolute value of the gamma function of vector elements

tgamma

Computes the gamma function of vector elements

expint1

Computes the exponential integral of vector elements

Rounding Routines

Description

floor

Rounds towards minus infinity

ceil

Rounds towards plus infinity

trunc

Rounds towards zero infinity

round

Rounds to nearest integer

nearbyint

Rounds according to current mode

rint

Rounds according to current mode and reports inexact result status

modf

Computes the integer and fractional parts

frac

Computes the fractional part

Miscellaneous Routines

Description

copysign

Returns vector of elements of one argument with signs changed to match other argument elements

nextafter

Returns vector of elements containing the next representable floating-point values following the values from the elements of one vector in the direction of the corresponding elements of another vector

fdim

Returns vector containing the differences of the corresponding elements of the vector arguments if the first is larger and +0 otherwise

fmax

Returns the larger of each pair of elements of the two vector arguments

fmin

Returns the smaller of each pair of elements of the two vector arguments

maxmag

Returns the element with the larger magnitude between each pair of elements of the two vector arguments

minmag

Returns the element with the smaller magnitude between each pair of elements of the two vector arguments

Parent topic: Vector Math