return x - ((x * x * x) / T(6)) + ((x * x * x * x * x) / T(120)) - ((x * x * x * x * x * x * x) / T(5040));
}
VECTORIZE_VEC(fastSin)
// cos
template <typename T>
GLM_FUNC_QUALIFIER T fastCos(T const & x)
{
return T(1) - (x * x * T(0.5)) + (x * x * x * x * T(0.041666666666)) - (x * x * x * x * x * x * T(0.00138888888888));
}
VECTORIZE_VEC(fastCos)
// tan
template <typename T>
GLM_FUNC_QUALIFIER T fastTan(T const & x)
{
return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539));
}
VECTORIZE_VEC(fastTan)
// asin
template <typename T>
GLM_FUNC_QUALIFIER T fastAsin(T const & x)
{
return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159));
GLM_FUNC_QUALIFIER T fastAtan(T const & y, T const & x)
{
T sgn = sign(y) * sign(x);
return abs(fastAtan(y / x)) * sgn;
}
VECTORIZE_VEC_VEC(fastAtan)
template <typename T>
GLM_FUNC_QUALIFIER T fastAtan(T const & x)
{
return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909));