diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp index c7ad3e6e..c45007b8 100644 --- a/test/gtx/gtx_fast_trigonometry.cpp +++ b/test/gtx/gtx_fast_trigonometry.cpp @@ -9,10 +9,29 @@ #include #include +#include + +int test_fastSin() +{ + int Error(0); + + float DiffMax = 0.0f; + for(std::size_t i = 0; i < 10000; ++i) + { + float angle = glm::pi() * 2.0f / static_cast(i + 1); + float A = glm::sin(angle); + float B = glm::fastSin(angle); + DiffMax = glm::max(DiffMax, glm::abs(B - A)); + } + + return Error; +} int main() { int Error(0); + Error += test_fastSin(); + return Error; }