Developer Reference

  • 0.9
  • 09/09/2020
  • Public Content
Contents

v?Cos

Computes cosine of vector elements.

Syntax

vsCos
(
n
,
a
,
y
)
;
vsCosI(n, a, inca, y, incy);
vmsCos
(
n
,
a
,
y
,
mode
)
;
vmsCosI(n, a, inca, y, incy, mode);
vdCos
(
n
,
a
,
y
)
;
vdCosI(n, a, inca, y, incy);
vmdCos
(
n
,
a
,
y
,
mode
)
;
vmdCosI(n, a, inca, y, incy, mode);
vcCos
(
n
,
a
,
y
)
;
vcCosI(n, a, inca, y, incy);
vmcCos
(
n
,
a
,
y
,
mode
)
;
vmcCosI(n, a, inca, y, incy, mode);
vzCos
(
n
,
a
,
y
)
;
vzCosI(n, a, inca, y, incy);
vmzCos
(
n
,
a
,
y
,
mode
)
;
vmzCosI(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
vsCos
,
vmsCos
const double*
for
vdCos
,
vmdCos
const MKL_Complex8*
for
vcCos
,
vmcCos
const MKL_Complex16*
for
vzCos
,
vmzCos
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
vsCos
,
vmsCos
double*
for
vdCos
,
vmdCos
MKL_Complex8*
for
vcCos
,
vmcCos
MKL_Complex16*
for
vzCos
,
vmzCos
Pointer to an array that contains 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)
.
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
This notice covers the following instruction sets: SSE2, SSE4.2, AVX2, AVX-512.

Product and Performance Information

1

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