Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/31/2023
Public

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

Document Table of Contents

v?Sqrt

Computes a square root of vector elements.

Syntax

call vssqrt( n, a, y )

call vssqrti(n, a, inca, y, incy)

call vmssqrt( n, a, y, mode )

call vmssqrti(n, a, inca, y, incy, mode)

call vdsqrt( n, a, y )

call vdsqrti(n, a, inca, y, incy)

call vmdsqrt( n, a, y, mode )

call vmdsqrti(n, a, inca, y, incy, mode)

call vcsqrt( n, a, y )

call vcsqrti(n, a, inca, y, incy)

call vmcsqrt( n, a, y, mode )

call vmcsqrti(n, a, inca, y, incy, mode)

call vzsqrt( n, a, y )

call vzsqrti(n, a, inca, y, incy)

call vmzsqrt( n, a, y, mode )

call vmzsqrti(n, a, inca, 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

DOUBLE PRECISION for vdsqrt, vmdsqrt

COMPLEX for vcsqrt, vmcsqrt

DOUBLE COMPLEX for vzsqrt, vmzsqrt

REAL, INTENT(IN) for vssqrt, vmssqrt

DOUBLE PRECISION, INTENT(IN) for vdsqrt, vmdsqrt

COMPLEX, INTENT(IN) for vcsqrt, vmcsqrt

DOUBLE COMPLEX, INTENT(IN) for vzsqrt, vmzsqrt

Array that specifies the input vector a.

inca, incy

INTEGER, INTENT(IN)

Specifies increments for the elements of a 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

REAL for vssqrt, vmssqrt

DOUBLE PRECISION for vdsqrt, vmdsqrt

COMPLEX for vcsqrt, vmcsqrt

DOUBLE COMPLEX for vzsqrt, vmzsqrt

REAL, INTENT(OUT) for vssqrt, vmssqrt

DOUBLE PRECISION, INTENT(OUT) for vdsqrt, vmdsqrt

COMPLEX, INTENT(OUT) for vcsqrt, vmcsqrt

DOUBLE COMPLEX, INTENT(OUT) for vzsqrt, vmzsqrt

Array that specifies 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· ++i· ++i· ++i· ++i· ++i· ++i·
+i·Y +0+i·         ++i·0

QNAN+i·QNAN

+i·0 +0+i·   +0+i·0 +0+i·0   ++i·0

QNAN+i·QNAN

-i·0 +0-i·   +0-i·0 +0-i·0   +-i·0

QNAN+i·QNAN

-i·Y +0-i·         +-i·0

QNAN+i·QNAN

-i· +-i· +-i· +-i· +-i· +-i· +-i· +-i·
+i·NAN

QNAN+i·QNAN

QNAN+i·QNAN

QNAN+i·QNAN

QNAN+i·QNAN

QNAN+i·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)).