Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
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

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 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 for possible values and their description.

Output Parameters

Name

Type

Description

y

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