Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

v?Sub

Performs element by element subtraction of vector b from vector a.

Syntax

call vssub( n, a, b, y )

call vssubi(n, a, inca, b, incb, y, incy)

call vmssub( n, a, b, y, mode )

call vmssubi(n, a, inca, b, incb, y, incy, mode)

call vdsub( n, a, b, y )

call vdsubi(n, a, inca, b, incb, y, incy)

call vmdsub( n, a, b, y, mode )

call vmdsubi(n, a, inca, b, incb, y, incy, mode)

call vcsub( n, a, b, y )

call vcsubi(n, a, inca, b, incb, y, incy)

call vmcsub( n, a, b, y, mode )

call vmcsubi(n, a, inca, b, incb, y, incy, mode)

call vzsub( n, a, b, y )

call vzsubi(n, a, inca, b, incb, y, incy)

call vmzsub( n, a, b, y, mode )

call vmzsubi(n, a, inca, b, incb, y, incy, mode)

Include Files
  • mkl_vml.f90
Input Parameters

Name

Type

Description

n

INTEGER, INTENT(IN)

Specifies the number of elements to be calculated.

a, b

DOUBLE PRECISION for vdsub, vmdsub

COMPLEX for vcsub, vmcsub

DOUBLE COMPLEX for vzsub, vmzsub

REAL, INTENT(IN) for vssub, vmssub

DOUBLE PRECISION, INTENT(IN) for vdsub, vmdsub

COMPLEX, INTENT(IN) for vcsub, vmcsub

DOUBLE COMPLEX, INTENT(IN) for vzsub, vmzsub

Arrays that specify the input vectors a and b.

inca, incb, incy

INTEGER, INTENT(IN)

Specifies increments for the elements of a, b, and y.

mode

INTEGER(KIND=8), INTENT(IN)

Overrides global VM mode setting for this function call. See vmlSetMode for possible values and their description.

Output Parameters

Name

Type

Description

y

FORTRAN 77: REAL for vssub, vmssub

DOUBLE PRECISION for vdsub, vmdsub

COMPLEX for vcsub, vmcsub

DOUBLE COMPLEX for vzsub, vmzsub

REALINTENT(OUT) for vssub, vmssub

DOUBLE PRECISION, INTENT(OUT) for vdsub, vmdsub

COMPLEX, INTENT(OUT) for vcsub, vmcsub

DOUBLE COMPLEX, INTENT(OUT) for vzsub, vmzsub

Array that specifies 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).