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?Pow

Computes a to the power b for elements of two vectors.

Syntax

call vspow( n, a, b, y )

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

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

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

call vdpow( n, a, b, y )

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

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

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

call vcpow( n, a, b, y )

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

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

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

call vzpow( n, a, b, y )

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

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

call vmzpowi(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 vdpow, vmdpow

COMPLEX for vcpow, vmcpow

DOUBLE COMPLEX for vzpow, vmzpow

REAL, INTENT(IN) for vspow, vmspow

DOUBLE PRECISION, INTENT(IN) for vdpow, vmdpow

COMPLEX, INTENT(IN) for vcpow, vmcpow

DOUBLE COMPLEX, INTENT(IN) for vzpow, vmzpow

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.

Precision Overflow Thresholds for Real v?Pow Function
Data Type Threshold Limitations on Input Parameters
single precision abs(a[i]) < ( FLT_MAX )1/b[i]
double precision abs(a[i]) < ( DBL_MAX )1/b[i]

Precision overflow thresholds for the complex v?Pow function are beyond the scope of this document.

Output Parameters

Name

Type

Description

y

DOUBLE PRECISION for vdpow, vmdpow

COMPLEX for vcpow, vmcpow

DOUBLE COMPLEX for vzpow, vmzpow

REAL, INTENT(OUT) for vspow, vmspow

DOUBLE PRECISION, INTENT(OUT) for vdpow, vmdpow

COMPLEX, INTENT(OUT) for vcpow, vmcpow

DOUBLE COMPLEX, INTENT(OUT) for vzpow, vmzpow

Array that specifies the output vector y.

Description

The v?Pow function computes a to the power b for elements of two vectors.

The real function v(s/d)Pow has certain limitations on the input range of a and b parameters. Specifically, if a[i] is positive, then b[i] may be arbitrary. For negative a[i], the value of b[i] must be an integer (either positive or negative).

The complex function v(c/z)Pow has no input range limitations.

Special values for Real Function v?Pow(x,y)

Argument 1

(X)

Argument 2

(Y)

Result

VM Error Status

Exception

+0 neg. odd integer + VML_STATUS_ERRDOM ZERODIVIDE
-0 neg. odd integer - VML_STATUS_ERRDOM ZERODIVIDE
+0 neg. even integer + VML_STATUS_ERRDOM ZERODIVIDE
-0 neg. even integer + VML_STATUS_ERRDOM ZERODIVIDE
+0 neg. non-integer + VML_STATUS_ERRDOM ZERODIVIDE
-0 neg. non-integer + VML_STATUS_ERRDOM ZERODIVIDE
-0 pos. odd integer +0    
-0 pos. odd integer -0    
+0 pos. even integer +0    
-0 pos. even integer +0    
+0 pos. non-integer +0    
-0 pos. non-integer +0    
-1 + +1    
-1 - +1    
+1 any value +1    
+1 +0 +1    
+1 -0 +1    
+1 + +1    
+1 - +1    
+1 QNAN +1    
any value +0 +1    
+0 +0 +1    
-0 +0 +1    
+ +0 +1    
- +0 +1    
QNAN +0 +1    
any value -0 +1    
+0 -0 +1    
-0 -0 +1    
+ -0 +1    
- -0 +1    
QNAN -0 +1    
X < +0 non-integer QNAN VML_STATUS_ERRDOM INVALID
|X| < 1 - +    
+0 - + VML_STATUS_ERRDOM ZERODIVIDE
-0 - + VML_STATUS_ERRDOM ZERODIVIDE
|X| > 1 - +0    
+ - +0    
- - +0    
|X| < 1 + +0    
+0 + +0    
-0 + +0    
|X| > 1 + +    
+ + +    
- + +    
- neg. odd integer -0    
- neg. even integer +0    
- neg. non-integer +0    
- pos. odd integer -    
- pos. even integer +    
- pos. non-integer +    
+ X < +0 +0    
+ X > +0 +    
Big finite value* Big finite value* +/- VML_STATUS_OVERFLOW OVERFLOW
QNAN QNAN QNAN    
QNAN SNAN QNAN   INVALID
SNAN QNAN QNAN   INVALID
SNAN SNAN QNAN   INVALID

The complex double precision versions of this function, vzPow and vmzPow, are implemented in the EP accuracy mode only. If used in HA or LA mode, vzPow and vmzPow set the VM Error Status to VML_STATUS_ACCURACYWARNING (see the Values of the VM Status table).

* Overflow in a real function is supported only in the HA/LA accuracy modes. The overflow occurs when x and y are finite numbers, but the result is too large to fit the target precision. In this case, the function:

  1. Returns in the result.

  2. Raises the OVERFLOW exception.

  3. Sets the VM Error Status to VML_STATUS_OVERFLOW.

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