# VML Mathematical Functions

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

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

For all VML mathematical functions, the input range of parameters is equal to the mathematical range of definition in the set of defined values for the respective data type. Several VML functions, specifically Div, Exp, Sinh, Cosh, and Pow, can result in an overflow. For these functions, the respective input threshold values that mark off the precision overflow are specified in the function description section. Note that in these specifications, FLT_MAX denotes the maximum number representable in single precision real data type, while DBL_MAX denotes the maximum number representable in double precision real data type.

Table “VML Mathematical Functions” lists available mathematical functions and data types associated with them.

VML Mathematical Functions
Function | Data Types | Description
--- | --- | ---
Arithmetic Functions
Add | s, d, c, z | Addition of the vector elements
Sub | s, d, c, z | Subtraction of the vector elements
Sqr | s, d | Squaring of the vector elements
Mul | s, d, c, z | Multiplication of the vector elements
MulByConj | c, z | Multiplication of elements of one vector by conjugated elements of the second vector
Conj | c, z | Conjugation of the vector elements
Abs | s, d, c, z | Absolute value of the vector elements
Power and Root Functions
Inv | s, d | Inversion of the vector elements
Div | s, d, c, z | Divide elements of one vector by elements of second vector
Sqrt | s, d, c, z | Square root of vector elements
InvSqrt | s, d | Inverse square root of vector elements
Cbrt | s, d | Cube root of vector elements
InvCbrt | s, d | Inverse cube root of vector elements
Pow2o3 | s, d | Each vector element raised to 2/3
Pow3o2 | s, d | Each vector element raised to 3/2
Pow | s, d, c, z | Each vector element raised to the specified power
Powx | s, d, c, z | Each vector element raised to the constant power
Hypot | s, d | Square root of sum of squares
Exponential and Logarithmic Functions
Exp | s, d, c, z | Exponential of vector elements
Expm1 | s, d | Exponential of vector elements decreased by 1
Ln | s, d, c, z | Natural logarithm of vector elements
Log10 | s, d, c, z | Denary logarithm of vector elements
Log1p | s, d | Natural logarithm of vector elements that are increased by 1
Trigonometric Functions
Cos | s, d, c, z | Cosine of vector elements
Sin | s, d, c, z | Sine of vector elements
SinCos | s, d | Sine and cosine of vector elements
CIS | c, z | Complex exponent of vector elements (cosine and sine combined to complex value)
Tan | s, d, c, z | Tangent of vector elements
Acos | s, d, c, z | Inverse cosine of vector elements
Asin | s, d, c, z | Inverse sine of vector elements
Atan | s, d, c, z | Inverse tangent of vector elements
Atan2 | s, d | Four-quadrant inverse tangent of elements of two vectors
Hyperbolic Functions
Cosh | s, d, c, z | Hyperbolic cosine of vector elements
Sinh | s, d, c, z | Hyperbolic sine of vector elements
Tanh | s, d, c, z | Hyperbolic tangent of vector elements
Acosh | s, d, c, z | Inverse hyperbolic cosine of vector elements
Asinh | s, d, c, z | Inverse hyperbolic sine of vector elements
Atanh | s, d, c, z | Inverse hyperbolic tangent of vector elements.
Special Functions
Erf | s, d | Error function value of vector elements
Erfc | s, d | Complementary error function value of vector elements
ErfInv | s, d | Inverse error function value of vector elements
Rounding Functions |
Floor | s, d | Rounding towards minus infinity
Ceil | s, d | Rounding towards plus infinity
Trunc | s, d | Rounding towards zero infinity
Round | s, d | Rounding to nearest integer
NearbyInt | s, d | Rounding according to current mode
Rint | s, d | Rounding according to current mode and raising inexact result exception
Modf | s, d | Integer and fraction parts