maths: add rsqrt convenience function

This commit is contained in:
Danny Robson 2018-04-17 17:01:29 +10:00
parent 76c809f031
commit 1678cb3a69

View File

@ -214,6 +214,15 @@ namespace util {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// exponentials // 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 < template <
typename BaseT, typename BaseT,
typename ExponentT, typename ExponentT,