Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
v?Cos
vsCos vdCos vcCos vzCos vmsCos vmdCos vmcCos vmzCos Computes cosine of vector elements.
Syntax
call vscos ( n , a , y )
call vscosi(n, a, inca, y, incy)
call vmscos ( n , a , y , mode )
call vmscosi(n, a, inca, y, incy, mode)
call vdcos ( n , a , y )
call vdcosi(n, a, inca, y, incy)
call vmdcos ( n , a , y , mode )
call vmdcosi(n, a, inca, y, incy, mode)
call vccos ( n , a , y )
call vccosi(n, a, inca, y, incy)
call vmccos ( n , a , y , mode )
call vmccosi(n, a, inca, y, incy, mode)
call vzcos ( n , a , y )
call vzcosi(n, a, inca, y, incy)
call vmzcos ( n , a , y , mode )
call vmzcosi(n, a, inca, y, incy, mode)
Include Files
mkl_vml.f90
Input Parameters
Name |
Type |
Description |
|---|---|---|
n |
Specifies the number of elements to be calculated. |
|
a |
Fortran 77: DOUBLE PRECISION for vdcos , vmdcosFortran 77: COMPLEX for vccos , vmccosFortran 77: DOUBLE PRECISION for vzcos , vmzcosFortran 90: REAL , INTENT(IN) for vscos , vmscosFortran 90: DOUBLE PRECISION , INTENT(IN) for vdcos , vmdcosFortran 90: COMPLEX , INTENT(IN) for vccos , vmccosFortran 90: DOUBLE PRECISION , INTENT(IN) for vzcos , vmzcos |
Array that specifies the input vector a . |
inca , incy |
INTEGER, INTENT(IN) |
Specifies increments for the elements of a and y . |
mode |
Overrides global VM mode setting for this function call. See vmlSetMode (Sets a new mode for VM functions according to the mode parameter and stores the previous VM mode to oldmode.) for possible values and their description. |
Output Parameters
Name |
Type |
Description |
|---|---|---|
y |
Fortran 77: DOUBLE PRECISION for vdcos , vmdcosFortran 77: COMPLEX for vccos , vmccosFortran 77: DOUBLE PRECISION for vzcos , vmzcosFortran 90: REAL , INTENT(OUT) for vscos , vmscosFortran 90: DOUBLE PRECISION , INTENT(OUT) for vdcos , vmdcosFortran 90: COMPLEX , INTENT(OUT) for vccos , vmccosFortran 90: DOUBLE PRECISION , INTENT(OUT) for vzcos , vmzcos |
Array that specifies the output vector y . |
Description
The v?Cos function computes cosine of vector elements.
Note that arguments abs(a[i]) ≤ 2^{13} and abs(a[i]) ≤ 2^{16} for single and double precisions respectively are called fast computational path. These are trigonometric function arguments for which VM provides the best possible performance. Avoid arguments that do not belong to the fast computational path in the VM High Accuracy (HA) and Low Accuracy (LA) functions. Alternatively, you can use VM Enhanced Performance (EP) functions that are fast on the entire function domain. However, these functions provide less accuracy.
Special Values for Real Function v?Cos(x)
Argument |
Result |
VM Error Status |
Exception |
|---|---|---|---|
+0 |
+1 |
||
-0 |
+1 |
||
|
QNAN |
VML_STATUS_ERRDOM |
INVALID |
|
QNAN |
VML_STATUS_ERRDOM |
INVALID |
QNAN |
QNAN |
||
SNAN |
QNAN |
INVALID |
Specifications for special values of the complex functions are defined according to the following formula
\(Cos(z) = Cosh(i*z)\) .
Product and Performance Information Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex . Notice revision #20201201