1 #ifndef VTESTBED_CORE_MATH_HH 2 #define VTESTBED_CORE_MATH_HH 6 #include <vtestbed/base/constants.hh> 7 #include <vtestbed/core/types.hh> 17 is_positive_infinity(T x) noexcept {
18 return !std::isfinite(x) && x > T(0);
23 is_negative_infinity(T x) noexcept {
24 return !std::isfinite(x) && x < T(0);
33 template <
class T,
int N>
36 auto m = blitz::minmax(x);
46 #if defined(FP_FAST_FMAF) || \ 51 fma<float>(
float a,
float x,
float b) {
52 return std::fma(a,x,b);
56 #if defined(FP_FAST_FMA) || \ 61 fma<double>(
double a,
double x,
double b) {
62 return std::fma(a,x,b);
86 #endif // vim:filetype=cpp
T scale(blitz::Array< T, N > x)
Return the difference between largest and smallest value in the array.