diff --git a/include/ircd/math/math.h b/include/ircd/math/math.h index daeca759e..b6292e37c 100644 --- a/include/ircd/math/math.h +++ b/include/ircd/math/math.h @@ -18,10 +18,3 @@ #include "pow.h" #include "fmma.h" #include "norm.h" - -namespace ircd -{ - using math::mean; - using math::tanh; - using math::pow; -} diff --git a/include/ircd/math/mean.h b/include/ircd/math/mean.h index 292d33694..e9a98a2ca 100644 --- a/include/ircd/math/mean.h +++ b/include/ircd/math/mean.h @@ -24,6 +24,11 @@ namespace ircd::math mean(const vector_view); } +namespace ircd +{ + using math::mean; +} + template inline typename std::enable_if(), ircd::simd::lane_type>::type diff --git a/include/ircd/math/pow.h b/include/ircd/math/pow.h index 894f5da3a..2c1f61355 100644 --- a/include/ircd/math/pow.h +++ b/include/ircd/math/pow.h @@ -17,6 +17,50 @@ namespace ircd::math class E> typename std::enable_if(), T>::type pow(T, const E); + + template + typename std::enable_if(), T>::type + powf(T, const E); + + template + typename std::enable_if(), T>::type + powl(T, const E); +} + +namespace ircd +{ + using ::pow; + using ::powf; + using ::powl; + using math::pow; + using math::powf; + using math::powl; +} + +template +inline typename std::enable_if(), T>::type +ircd::math::powl(T a, + const E e) +{ + for(uint i(0); i < simd::lanes(); ++i) + a[i] = ::powl(a[i], e); + + return a; +} + +template +inline typename std::enable_if(), T>::type +ircd::math::powf(T a, + const E e) +{ + for(uint i(0); i < simd::lanes(); ++i) + a[i] = ::powf(a[i], e); + + return a; } template typename std::enable_if(), T>::type tanh(T); + + template + typename std::enable_if(), T>::type + tanhf(T); + + template + typename std::enable_if(), T>::type + tanhl(T); +} + +namespace ircd +{ + using ::tanh; + using ::tanhf; + using ::tanhl; + using math::tanh; + using math::tanhf; + using math::tanhl; +} + +template +inline typename std::enable_if(), T>::type +ircd::math::tanhl(T a) +{ + for(uint i(0); i < simd::lanes(); ++i) + a[i] = ::tanhl(a[i]); + + return a; +} + +template +inline typename std::enable_if(), T>::type +ircd::math::tanhf(T a) +{ + for(uint i(0); i < simd::lanes(); ++i) + a[i] = ::tanhf(a[i]); + + return a; } template