VF_secrpiVD_secrpiVE_secrpi
VF_secrpi2VD_secrpi2VE_secrpi2
VF_secrpi3VD_secrpi3VE_secrpi3
FunctionSecant function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_secrpi( fVector Y, iVector P, ui size, int q );
int VF_secrpi2( fVector Y, iVector P, ui size, int q );
int VF_secrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::secrpi( const vector<int>& P, int q );
int vector<T>::secrpi2( const vector<int>& P, int q );
int vector<T>::secrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_secrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_secrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_secrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_secrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_secrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_secrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_secrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_secrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_secrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_secrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_secrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_secrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = sec( (Pi / q) * p )
The secant of fractional multiples of p is calculated. There are three versions: VF_secrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_secrpi2 should be used which is a highly optimized version utilizing a look-up table. If q is a multiple of 3, VF_secrpi3 should be used. VF_secrpi2 and VF_secrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingSING errors occur if Pi / q is an odd multiple of 1/2; the default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL; similarly to VF_cosecrpi2, 0.0 is chosen irrespective to the fact that it is not a valid result of the secant function!);
q must be non-zero; this is, however, not tested for.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sec,  cos

VectorLib Table of Contents  OptiVec home