Developer Reference for Intel® oneAPI Math Kernel Library for C
v?Sub
Performs element by element subtraction of vector b from vector a .
Syntax
vhSub ( n , a , b , y ) ;
vhSubI(n, a, inca, b, incb, y, incy);
vmhSub ( n , a , b , y , mode ) ;
vmhSubI(n, a, inca, b, incb, y, incy, mode);
vsSub ( n , a , b , y ) ;
vsSubI(n, a, inca, b, incb, y, incy);
vmsSub ( n , a , b , y , mode ) ;
vmsSubI(n, a, inca, b, incb, y, incy, mode);
vdSub ( n , a , b , y ) ;
vdSubI(n, a, inca, b, incb, y, incy);
vmdSub ( n , a , b , y , mode ) ;
vmdSubI(n, a, inca, b, incb, y, incy, mode);
vcSub ( n , a , b , y ) ;
vcSubI(n, a, inca, b, incb, y, incy);
vmcSub ( n , a , b , y , mode ) ;
vmcSubI(n, a, inca, b, incb, y, incy, mode);
vzSub ( n , a , b , y ) ;
vzSubI(n, a, inca, b, incb, y, incy);
vmzSub ( n , a , b , y , mode ) ;
vmzSubI(n, a, inca, b, incb, 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 , b |
const _Float16* for vhSub , vmhSub const float* for vsSub , vmsSub const double* for vdSub , vmdSub const MKL_Complex8* for vcSub , vmcSub const MKL_Complex16* for vzSub , vmzSub |
Pointers to arrays that contain the input vectors a and b . |
inca , incb , incy |
const MKL_INT |
Specifies increments for the elements of a , b , 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 vhSub , vmhSub float* for vsSub , vmsSub double* for vdSub , vmdSub MKL_Complex8* for vcSub , vmcSub MKL_Complex16* for vzSub , vmzSub |
Pointer to an array that contains the output vector y . |
Description
The v?Sub function performs element by element subtraction of vector b from vector a .
Special values for Real Function v?Sub(x)
Argument 1 |
Argument 2 |
Result |
Exception |
|---|---|---|---|
+0 |
+0 |
+0 |
|
+0 |
-0 |
+0 |
|
-0 |
+0 |
-0 |
|
-0 |
-0 |
+0 |
|
|
|
QNAN |
INVALID |
|
|
|
|
|
|
|
|
|
|
QNAN |
INVALID |
SNAN |
any value |
QNAN |
INVALID |
any value |
SNAN |
QNAN |
INVALID |
QNAN |
non-SNAN |
QNAN |
|
non-SNAN |
QNAN |
QNAN |
Specifications for special values of the complex functions are defined according to the following formula
\(Sub(x1+i*y1,x2+i*y2) = (x1-x2) + i*(y1-y2)\) .
Overflow in a complex function occurs (supported in the HA / LA accuracy modes only) when all \(RE(x)\) , \(RE(y)\) , \(IM(x)\) , \(IM(y)\) arguments are finite numbers, but the real or imaginary part of the computed result is so large that it does not fit the target precision. In this case, the function returns ∞ in that part of the result, raises the OVERFLOW exception, and sets the VM Error Status to VML_STATUS_OVERFLOW (overriding any possible VML_STATUS_ACCURACYWARNING status).