v?SinCos

Computes sine and cosine of vector elements.

Syntax

FORTRAN:

call vssincos( n, a, y, z )

call vmssincos( n, a, y, z, mode )

call vdsincos( n, a, y, z )

call vmdsincos( n, a, y, z, mode )

C:

vsSinCos( n, a, y, z );

vmsSinCos( n, a, y, z, mode );

vdSinCos( n, a, y, z );

vmdSinCos( n, a, y, z, 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

FORTRAN 77: REAL for vssincos, vmssincos

DOUBLE PRECISION for vdsincos, vmdsincos

Fortran 90: REAL, INTENT(IN) for vssincos, vmssincos

DOUBLE PRECISION, INTENT(IN) for vdsincos, vmdsincos

C: const float* for vsSinCos, vmsSinCos

const double* for vdSinCos, vmdSinCos

FORTRAN: Array that specifies the input vector a.

C: Pointer to an array that contains the input vector a.

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.

Output Parameters

Name

Type

Description

y, z

FORTRAN 77: REAL for vssincos, vmssincos

DOUBLE PRECISION for vdsincos, vmdsincos

Fortran 90: REAL, INTENT(OUT) for vssincos, vmssincos

DOUBLE PRECISION, INTENT(OUT) for vdsincos, vmdsincos

C: float* for vsSinCos, vmsSinCos

double* for vdSinCos, vmdSinCos

FORTRAN: Arrays that specify the output vectors y (for sine values) and z (for cosine values).

C: Pointers to arrays that contain the output vectors y (for sinevalues) and z(for cosine values).

Description

This function is declared in mkl_vml.f77 for FORTRAN 77 interface, in mkl_vml.f90 for Fortran 90 interface, and in mkl_vml_functions.h for C interface.

The function computes sine and 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 VML provides the best possible performance. Avoid arguments that do not belong to the fast computational path in the VML High Accuracy (HA) and Low Accuracy (LA) functions. Alternatively, you can use VML Enhanced Performance (EP) functions that are fast on the entire function domain. However, these functions provide less accuracy.

Special Values for Real Function v?SinCos(x)
Argument Result 1 Result 2 VML Error Status Exception
+0 +0 +1    
-0 -0 +1    
+ QNAN QNAN VML_STATUS_ERRDOM INVALID
- QNAN QNAN VML_STATUS_ERRDOM INVALID
QNAN QNAN QNAN    
SNAN QNAN QNAN   INVALID

Specifications for special values of the complex functions are defined according to the following formula

Sin(z) = -i*Sinh(i*z).


Submit feedback on this help topic