|
@@ -502,23 +502,6 @@ constexpr T sqrt(T x)
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
-template<FloatingPoint T>
|
|
|
|
-constexpr T rsqrt(T x)
|
|
|
|
-{
|
|
|
|
-#if ARCH(AARCH64)
|
|
|
|
- AARCH64_INSTRUCTION(frsqrte, x);
|
|
|
|
-#elif ARCH(X86_64)
|
|
|
|
- if constexpr (IsSame<T, float>) {
|
|
|
|
- float res;
|
|
|
|
- asm("rsqrtss %1, %0"
|
|
|
|
- : "=x"(res)
|
|
|
|
- : "x"(x));
|
|
|
|
- return res;
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
- return (T)1. / sqrt(x);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
template<FloatingPoint T>
|
|
template<FloatingPoint T>
|
|
constexpr T cbrt(T x)
|
|
constexpr T cbrt(T x)
|
|
{
|
|
{
|