Intel® oneAPI Math Kernel Library Developer Reference - Fortran
Computes cosine of vector elements.
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)
Name |
Type |
Description |
---|---|---|
n |
INTEGER, INTENT(IN) |
Specifies the number of elements to be calculated. |
a |
DOUBLE PRECISION for vdcos, vmdcos COMPLEX for vccos, vmccos DOUBLE PRECISION for vzcos, vmzcos REAL, INTENT(IN) for vscos, vmscos DOUBLE PRECISION, INTENT(IN) for vdcos, vmdcos COMPLEX, INTENT(IN) for vccos, vmccos 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 |
INTEGER(KIND=8), INTENT(IN) |
Overrides global VM mode setting for this function call. See vmlSetMode for possible values and their description. |
Name |
Type |
Description |
---|---|---|
y |
DOUBLE PRECISION for vdcos, vmdcos COMPLEX for vccos, vmccos DOUBLE PRECISION for vzcos, vmzcos REAL, INTENT(OUT) for vscos, vmscos DOUBLE PRECISION, INTENT(OUT) for vdcos, vmdcos COMPLEX, INTENT(OUT) for vccos, vmccos DOUBLE PRECISION, INTENT(OUT) for vzcos, vmzcos |
Array that specifies the output vector y. |
The v?Cos function computes cosine of vector elements.
Note that arguments abs(a[i]) ≤ 213 and abs(a[i]) ≤ 216 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.
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).
Optimization Notice |
---|
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 |