34 #define ELEMENT_COUNT(x) c7x::element_count_of<x>::value
62 x1 = x1 * (two - (a * x1));
63 y = x1 * (two - (a * x1));
68 __vpred cmp_eqzero = __cmp_eq_pred((vecType) a, zero);
69 y = __select(cmp_eqzero, zero, y);
76 vecType c12, c10, c8, c6, c4, c2;
79 c12 = (vecType) 0.00457708084094171;
80 c10 = (vecType) 0.00867365970442499;
81 c8 = (vecType) 0.0236488997700456;
82 c6 = (vecType) 0.0523817525811416;
83 c4 = (vecType) 0.133766510899828;
84 c2 = (vecType) 0.333299506194791;
86 vecType x2, x4, x6, x8, pol;
103 tmp1 = ((c8 * x8) + (c6 * x6)) + ((c4 * x4) + (c2 * x2));
104 tmp2 = x8 * ((c10 * x2) + (c12 * x4));
106 pol = ((tmp1 + tmp2) * x) + x;
117 size_t numBlocks = 0;
118 size_t remNumBlocks = 0;
121 typedef typename c7x::make_full_vector<T>::type vec;
128 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
129 __SA_TEMPLATE_v1 sa0Params = __gen_SA_TEMPLATE_v1();
138 numBlocks = length / c7x::element_count_of<vec>::value;
139 remNumBlocks = length % c7x::element_count_of<vec>::value;
147 vec pi4, pi2_h, pi2_l, pi, invPI, C1, C2, C3, one, zero, negativeOne, res, y, temp, temp_gtPI4, res_gtPI4,
150 pi4 = (vec) 0.785398163;
151 pi2_h = (vec) 1.570796;
152 pi2_l = (vec) 3.26794896476912e-7;
153 pi = (vec) 3.14159265358979;
155 C2 = (vec) 9.676535e-4;
156 C3 = (vec) 8.97930618748433e-11;
157 invPI = (vec) 0.318309886183791;
160 negativeOne = (vec) -1.0;
165 for (
size_t i = 0; i < numBlocks; i++) {
166 vec a = c7x::strm_eng<0, vec>::get_adv();
173 N = __float_to_int(temp);
175 y = ((a - (c7x::convert<vec>(N) * C1)) - (c7x::convert<vec>(N) * C2)) - (c7x::convert<vec>(N) * C3);
180 vec yminusPi = y - pi;
181 __vpred cmp_gt = __cmp_lt_pred((vec) pi2_h, y);
182 y = __select(cmp_gt, yminusPi, y);
189 __vpred cmp_zero = __cmp_lt_pred(y, zero);
190 y = __select(cmp_zero, negativeY, y);
192 vec Sign_vec = __select(cmp_zero, negativeOne, sign);
194 __vpred cmp_yPI4 = __cmp_lt_pred(pi4, y);
196 y_gtPI4 = (pi2_h - y) + pi2_l;
197 temp_gtPI4 = pol_est_tansp_i<vec>(y_gtPI4);
198 res_gtPI4 = recipsp_tansp_i<vec>(temp_gtPI4);
199 res = pol_est_tansp_i<vec>(y);
201 res = __select(cmp_yPI4, res_gtPI4, res);
203 res = res * Sign_vec;
205 __vpred tmp = c7x::strm_agen<0, vec>::get_vpred();
206 vec *VB1 = c7x::strm_agen<0, vec>::get_adv(pDst);
208 __vstore_pred(tmp, VB1, res);
static vecType pol_est_tansp_i(vecType x)
static vecType recipsp_tansp_i(vecType a)
template MATHLIB_STATUS MATHLIB_tan< float >(size_t length, float *pSrc, float *pDst)
static void MATHLIB_SE0SA0Close()
This method performs SE0 and SA0 close.
static void MATHLIB_SE0SA01DSequentialInit(__SE_TEMPLATE_v1 *se0Params, __SA_TEMPLATE_v1 *sa0Params, size_t length, T *pSrc, T *pDst)
static MATHLIB_STATUS MATHLIB_checkParams(size_t length, T *pSrc, T *pDst)
This method performs parameter checks for MATHLIB function.
static void MATHLIB_SE0SA0Open(__SE_TEMPLATE_v1 *se0Params, __SA_TEMPLATE_v1 *sa0Params, T *pSrc)
This method performs SE0 and SA0 open.
MATHLIB_STATUS MATHLIB_tan_sp(size_t length, float *pSrc, float *pDst)
This function is the C interface for MATHLIB_tan. Function accepts float pointers.
MATHLIB_STATUS MATHLIB_tan(size_t length, T *pSrc, T *pDst)
Performs the elementwise tangent of an input vector. Function can be overloaded with float pointers,...
MATHLIB_STATUS_NAME
The enumeration of all status codes.