Power functions

Calculates the reciprocal of the square root of the argument.

template<FloatingPointType T>
constexpr inline T ReciprocalSqrt( T x ) noexcept

Example/Test code

using C = Constants<float>;
constexpr auto result1 = ReciprocalSqrt( C::NaN );
BOOST_CHECK( IsNaN( result1 ) );

constexpr auto result2 = ReciprocalSqrt( C::NegativeNaN );
BOOST_CHECK( IsNaN( result2 ) );

constexpr auto result3 = ReciprocalSqrt( C::Infinity );
BOOST_CHECK( result3 == C::Zero );

constexpr auto result4 = ReciprocalSqrt( C::NegativeInfinity );
BOOST_CHECK( IsNaN( result4 ) );

constexpr auto result5 = ReciprocalSqrt( -C::Min );
BOOST_CHECK( IsNaN( result5 ) );

constexpr auto result6 = ReciprocalSqrt( C::Zero );
BOOST_CHECK( IsInf( result6 ) );

constexpr auto result7 = ReciprocalSqrt( C::Min );
auto expected7 = C::One / std::sqrt( C::Min );
BOOST_CHECK( result7 == expected7 );

constexpr auto result8 = ReciprocalSqrt( C::Max );
auto expected8 = C::One / std::sqrt( C::Max );
BOOST_CHECK( result8 == expected8 );