Developer Reference for Intel® oneAPI Math Kernel Library for C
v?Sqrt
vsSqrt vdSqrt vcSqrt vzSqrt vmsSqrt vmdSqrt vmcSqrt vmzSqrt Computes a square root of vector elements.
Syntax
vhSqrt ( n , a , y ) ;
vhSqrtI(n, a, inca, y, incy);
vmhSqrt ( n , a , y , mode ) ;
vmhSqrtI(n, a, inca, y, incy, mode);
vsSqrt ( n , a , y ) ;
vsSqrtI(n, a, inca, y, incy);
vmsSqrt ( n , a , y , mode ) ;
vmsSqrtI(n, a, inca, y, incy, mode);
vdSqrt ( n , a , y ) ;
vdSqrtI(n, a, inca, y, incy);
vmdSqrt ( n , a , y , mode ) ;
vmdSqrtI(n, a, inca, y, incy, mode);
vcSqrt ( n , a , y ) ;
vcSqrtI(n, a, inca, y, incy);
vmcSqrt ( n , a , y , mode ) ;
vmcSqrtI(n, a, inca, y, incy, mode);
vzSqrt ( n , a , y ) ;
vzSqrtI(n, a, inca, y, incy);
vmzSqrt ( n , a , y , mode ) ;
vmzSqrtI(n, a, inca, y, incy, mode);
Include Files
mkl.h
Input Parameters
Name |
Type |
Description |
|---|---|---|
n |
const MKL_INT |
Specifies the number of elements to be calculated. |
a |
const _Float16* for vhSqrt , vmhSqrt const float* for vsSqrt , vmsSqrt const double* for vdSqrt , vmdSqrt const MKL_Complex8* for vcSqrt , vmcSqrt const MKL_Complex16* for vzSqrt , vmzSqrt |
Pointer to an array that contains the input vector a . |
inca , incy |
const MKL_INT |
Specifies increments for the elements of a and y . |
mode |
const MKL_INT64 |
Overrides global VM mode setting for this function call. See vmlSetMode (Sets a new mode for VM functions according to the mode parameter and stores the previous VM mode to oldmode.) for possible values and their description. |
Output Parameters
Name |
Type |
Description |
|---|---|---|
y |
_Float16* for vhSqrt , vmhSqrt float* for vsSqrt , vmsSqrt double* for vdSqrt , vmdSqrt MKL_Complex8* for vcSqrt , vmcSqrt MKL_Complex16* for vzSqrt , vmzSqrt |
Pointer to an array that contains the output vector y . |
Description
The v?Sqrt function computes a square root of vector elements.
Special Values for Real Function v?Sqrt(x)
Argument |
Result |
VM Error Status |
Exception |
|---|---|---|---|
X < +0 |
QNAN |
VML_STATUS_ERRDOM |
INVALID |
+0 |
+0 |
||
-0 |
-0 |
||
|
QNAN |
VML_STATUS_ERRDOM |
INVALID |
|
|
||
QNAN |
QNAN |
||
SNAN |
QNAN |
INVALID |
See Special Value Notations for the conventions used in the table below.
Special Values for Complex Function v?Sqrt(z)
RE(z) i · IM(z) |
|
-X |
-0 |
+0 |
+X |
|
NAN |
|---|---|---|---|---|---|---|---|
+i · ∞ |
|
|
|
|
|
|
|
+i · Y |
+0+i · ∞ |
|
QNAN+i · QNAN |
||||
+i · 0 |
+0+i · ∞ |
+0+i · 0 |
+0+i · 0 |
|
QNAN+i · QNAN |
||
-i · 0 |
+0-i · ∞ |
+0-i · 0 |
+0-i · 0 |
|
QNAN+i · QNAN |
||
-i · Y |
+0-i · ∞ |
|
QNAN+i · QNAN |
||||
-i · ∞ |
|
|
|
|
|
|
|
+i · NAN |
QNAN+i · QNAN |
QNAN+i · QNAN |
QNAN+i · QNAN |
QNAN+i · QNAN |
QNAN+i · QNAN |
|
QNAN+i · QNAN |
Notes:
raises INVALID exception when the real or imaginary part of the argument is SNAN
Sqrt(CONJ(z))=CONJ(Sqrt(z)) .