Added experiment for new fastCos. More sRGB tests.

This commit is contained in:
Christophe Riccio
2015-06-27 18:36:17 +02:00
parent 83409a0720
commit 08eedc6209
5 changed files with 342 additions and 29 deletions

View File

@@ -33,6 +33,16 @@
namespace glm{
namespace detail
{
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> taylorCos(vecType<T, P> const & x)
{
return static_cast<T>(1)
- (x * x) / 2.f
+ (x * x * x * x) / 24.f
- (x * x * x * x * x * x) / 720.f
+ (x * x * x * x * x * x * x * x) / 40320.f;
}
template <typename T>
GLM_FUNC_QUALIFIER T cos_52s(T x)
{
@@ -66,11 +76,11 @@ namespace detail
{
T const angle(wrapAngle<T>(x));
if(angle<half_pi<T>())
if(angle < half_pi<T>())
return detail::cos_52s(angle);
if(angle<pi<T>())
if(angle < pi<T>())
return -detail::cos_52s(pi<T>() - angle);
if(angle<(T(3) * half_pi<T>()))
if(angle < (T(3) * half_pi<T>()))
return -detail::cos_52s(angle - pi<T>());
return detail::cos_52s(two_pi<T>() - angle);