From 1678cb3a6917428de2d34e09457d1b1393ec234e Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 17 Apr 2018 17:01:29 +1000 Subject: [PATCH] maths: add rsqrt convenience function --- maths.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maths.hpp b/maths.hpp index a9f0fb54..4562d655 100644 --- a/maths.hpp +++ b/maths.hpp @@ -214,6 +214,15 @@ namespace util { /////////////////////////////////////////////////////////////////////////// // exponentials + + // reciprocal sqrt, provided so that we can search for usages and replace + // at a later point with a more efficient implementation. + inline float + rsqrt (float val) + { + return 1 / std::sqrt (val); + } + template < typename BaseT, typename ExponentT,