FunctionSquare of the sine and of the cosine simultaneously
Syntax C/C++#include <VFmath.h>
int VF_sincos2( fVector YSin2, fVector YCos2, fVector X, ui size );
int VFx_sincos2( fVector YSin2, fVector YCos2, fVector X, ui size, float A, float B, float C );
int VFr_sincos2( fVector YSin, fVector YCos, fVector X, ui size );
int VFrx_sincos2(fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sincos2( vector<T> YCos2, const vector<T>& X );
int vector<T>::x_sincos2( vector<T> YCos2, const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_sincos2( vector<T> YCos, const vector<T>& X );
int vector<T>::rx_sincos2( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sincos2( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFx_sincos2( Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VFr_sincos2( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFrx_sincos2(Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size );
int cudaVFx_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sincos2( fVector h_YSin, fVector h_YCos, fVector h_X, ui size );
int VFxcu_sincos2( fVector h_YSin, fVector h_YCos, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sincos2( h_YSin, h_YCos, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sincos2( h_YSin, h_YCos, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionnormal versions:
YSin2i = sin2( Xi )
YCos2i = cos2( Xi )
expanded versions:
YSin2i = C * sin2( A*Xi+B )
YCos2i = C * cos2( A*Xi+B )
The squared sine and the squared cosine are calculated simultaneously, which is far more efficient than calculating them separately, if both of them are needed.
The reduced-range versions with the prefixes VFr_ and VFrx_ are for situations in which one can be sure that all input values lie in the range -2p <= Xi <= +2p.
Error handlingPrecision errors lead to a result of 0.0 for the sin2 and of 1.0 for the cos2 (as if the input were 0.0) along with a non-zero return value, but are otherwise ignored; _matherr is not called. Other errors should not occur.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sincos,   sin,   cos

VectorLib Table of Contents  OptiVec home