瀏覽代碼

Optimized taylorCos

Christophe Riccio 9 年之前
父節點
當前提交
29535189f1
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      glm/gtx/fast_trigonometry.inl

+ 4 - 4
glm/gtx/fast_trigonometry.inl

@@ -8,10 +8,10 @@ namespace detail
 	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;
+			- (x * x) * (1.f / 2.f)
+			+ (x * x * x * x) * (1.f / 24.f)
+			- (x * x * x * x * x * x) * (1.f / 720.f)
+			+ (x * x * x * x * x * x * x * x) (1.f / 40320.f);
 	}
 
 	template <typename T>