v?Pow

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

Syntax

FORTRAN:

call vspow( n, a, b, y )

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

call vdpow( n, a, b, y )

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

call vcpow( n, a, b, y )

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

call vzpow( n, a, b, y )

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

C:

vsPow( n, a, b, y );

vmsPow( n, a, b, y, mode );

vdPow( n, a, b, y );

vmdPow( n, a, b, y, mode );

vcPow( n, a, b, y );

vmcPow( n, a, b, y, mode );

vzPow( n, a, b, y );

vmzPow( n, a, b, y, mode );

Include Files

Input Parameters

Name

Type

Description

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Specifies the number of elements to be calculated.

a, b

FORTRAN 77: REAL for vspow, vmspow

DOUBLE PRECISION for vdpow, vmdpow

COMPLEX for vcpow, vmcpow

DOUBLE COMPLEX for vzpow, vmzpow

Fortran 90: 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

C: const float* for vsPow, vmsPow

const double* for vdPow, vmdPow

const MKL_Complex8* for vcPow, vmcPow

const MKL_Complex16* for vzPow, vmzPow

FORTRAN: Arrays that specify the input vectors a and b.

C: Pointers to arrays that contain the input vectors a and b.

mode

FORTRAN 77: INTEGER*8

Fortran 90: INTEGER(KIND=8), INTENT(IN)

C: const MKL_INT64

Overrides global VML 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

FORTRAN 77: REAL for vspow, vmspow

DOUBLE PRECISION for vdpow, vmdpow

COMPLEX for vcpow, vmcpow

DOUBLE COMPLEX for vzpow, vmzpow

Fortran 90: 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

C: float* for vsPow, vmsPow

double* for vdPow, vmdPow

MKL_Complex8* for vcPow, vmcPow

MKL_Complex16* for vzPow, vmzPow

FORTRAN: Array that specifies the output vector y.

C: Pointer to an array that contains 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)
Argument 1 Argument 2 Result VML 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 +    
QNAN QNAN QNAN    
QNAN SNAN QNAN   INVALID
SNAN QNAN QNAN   INVALID
SNAN SNAN QNAN   INVALID

Overflow in a complex function occurs (supported in the HA/LA accuracy modes only) when x1, x2, y1, y2 are finite numbers, but the real or imaginary part of the exact 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 VML Error Status to VML_STATUS_OVERFLOW.


Submit feedback on this help topic