From 536bbc52f1548877acc990909726c751bfe2fce5 Mon Sep 17 00:00:00 2001 From: jtlap Date: Sun, 7 Jan 2024 18:08:20 +0100 Subject: [PATCH] Adapted math functions to new constant API --- include/eve/module/core/constant/allbits.hpp | 70 ++++++------ .../eve/module/core/constant/bitincrement.hpp | 70 ++++++------ include/eve/module/core/constant/eps.hpp | 79 ++++++-------- include/eve/module/core/constant/false.hpp | 45 ++++---- include/eve/module/core/decorator/core.hpp | 101 +++++++++--------- .../eve/module/core/decorator/roundings.hpp | 8 +- include/eve/module/math/constant/catalan.hpp | 60 +++++------ include/eve/module/math/constant/cbrt_pi.hpp | 60 +++++------ include/eve/module/math/constant/cos_1.hpp | 60 +++++------ include/eve/module/math/constant/cosh_1.hpp | 60 +++++------ include/eve/module/math/constant/egamma.hpp | 50 +++++---- .../eve/module/math/constant/egamma_sqr.hpp | 60 +++++------ include/eve/module/math/constant/epso_2.hpp | 42 ++++---- include/eve/module/math/constant/euler.hpp | 52 +++++---- include/eve/module/math/constant/exp_pi.hpp | 60 +++++------ .../math/constant/extreme_value_skewness.hpp | 61 ++++++----- .../module/math/constant/four_minus_pi.hpp | 60 +++++------ .../eve/module/math/constant/four_pio_3.hpp | 60 +++++------ include/eve/module/math/constant/glaisher.hpp | 60 +++++------ include/eve/module/math/constant/inv_2eps.hpp | 44 ++++---- include/eve/module/math/constant/inv_2pi.hpp | 60 +++++------ include/eve/module/math/constant/inv_e.hpp | 60 +++++------ .../eve/module/math/constant/inv_egamma.hpp | 60 +++++------ include/eve/module/math/constant/inv_pi.hpp | 60 +++++------ .../eve/module/math/constant/invcbrt_pi.hpp | 60 +++++------ .../eve/module/math/constant/invlog10_2.hpp | 52 +++++---- .../eve/module/math/constant/invlog10_e.hpp | 60 +++++------ .../eve/module/math/constant/invlog_10.hpp | 52 +++++---- include/eve/module/math/constant/invlog_2.hpp | 52 +++++---- .../eve/module/math/constant/invlog_phi.hpp | 60 +++++------ .../eve/module/math/constant/invsqrt_2.hpp | 53 +++++---- include/eve/module/math/constant/khinchin.hpp | 60 +++++------ include/eve/module/math/constant/log10_e.hpp | 53 +++++---- include/eve/module/math/constant/log2_e.hpp | 53 +++++---- include/eve/module/math/constant/log_10.hpp | 49 +++++---- include/eve/module/math/constant/log_2.hpp | 61 ++++++----- include/eve/module/math/constant/log_phi.hpp | 60 +++++------ include/eve/module/math/constant/loglog_2.hpp | 60 +++++------ include/eve/module/math/constant/maxlog.hpp | 47 ++++---- include/eve/module/math/constant/maxlog10.hpp | 47 ++++---- include/eve/module/math/constant/maxlog2.hpp | 47 ++++---- include/eve/module/math/constant/minlog.hpp | 47 ++++---- include/eve/module/math/constant/minlog10.hpp | 47 ++++---- .../module/math/constant/minlog10denormal.hpp | 50 +++++---- include/eve/module/math/constant/minlog2.hpp | 43 ++++---- .../module/math/constant/minlog2denormal.hpp | 46 ++++---- .../module/math/constant/minlogdenormal.hpp | 43 +++++--- include/eve/module/math/constant/phi.hpp | 50 +++++---- include/eve/module/math/constant/pi.hpp | 61 ++++++----- include/eve/module/math/constant/pi2.hpp | 60 +++++------ include/eve/module/math/constant/pi2o_16.hpp | 60 +++++------ include/eve/module/math/constant/pi2o_6.hpp | 60 +++++------ include/eve/module/math/constant/pi3.hpp | 60 +++++------ .../eve/module/math/constant/pi_minus_3.hpp | 60 +++++------ include/eve/module/math/constant/pi_pow_e.hpp | 60 +++++------ include/eve/module/math/constant/pio_2.hpp | 61 ++++++----- include/eve/module/math/constant/pio_3.hpp | 60 +++++------ include/eve/module/math/constant/pio_4.hpp | 61 ++++++----- include/eve/module/math/constant/pio_6.hpp | 60 +++++------ include/eve/module/math/constant/quarter.hpp | 39 ++++--- .../math/constant/rayleigh_kurtosis.hpp | 61 ++++++----- .../constant/rayleigh_kurtosis_excess.hpp | 61 ++++++----- .../math/constant/rayleigh_skewness.hpp | 61 ++++++----- .../eve/module/math/constant/rsqrt_2pi.hpp | 60 +++++------ include/eve/module/math/constant/rsqrt_e.hpp | 60 +++++------ include/eve/module/math/constant/rsqrt_pi.hpp | 55 +++++----- .../eve/module/math/constant/rsqrt_pio_2.hpp | 60 +++++------ include/eve/module/math/constant/sin_1.hpp | 60 +++++------ include/eve/module/math/constant/sinh_1.hpp | 60 +++++------ include/eve/module/math/constant/sixth.hpp | 60 +++++------ include/eve/module/math/constant/sqrt_2.hpp | 54 ++++++---- include/eve/module/math/constant/sqrt_2pi.hpp | 60 +++++------ include/eve/module/math/constant/sqrt_3.hpp | 51 +++++---- include/eve/module/math/constant/sqrt_e.hpp | 60 +++++------ include/eve/module/math/constant/sqrt_pi.hpp | 60 +++++------ .../eve/module/math/constant/sqrt_pio_2.hpp | 60 +++++------ .../eve/module/math/constant/sqrtlog_4.hpp | 60 +++++------ include/eve/module/math/constant/third.hpp | 60 +++++------ .../eve/module/math/constant/three_o_4.hpp | 60 +++++------ .../eve/module/math/constant/three_pio_4.hpp | 60 +++++------ include/eve/module/math/constant/two_o_3.hpp | 60 +++++------ include/eve/module/math/constant/two_o_pi.hpp | 60 +++++------ .../module/math/constant/two_o_sqrt_pi.hpp | 60 +++++------ include/eve/module/math/constant/two_pi.hpp | 60 +++++------ .../eve/module/math/constant/two_pio_3.hpp | 60 +++++------ include/eve/module/math/constant/zeta_2.hpp | 60 +++++------ include/eve/module/math/constant/zeta_3.hpp | 60 +++++------ include/eve/module/math/regular/impl/cos.hpp | 2 +- include/eve/traits/overload/protocol.hpp | 4 +- include/eve/traits/overload/supports.hpp | 4 +- test/doc/math/regular/catalan.cpp | 22 ++-- test/doc/math/regular/cbrt_pi.cpp | 16 +-- test/doc/math/regular/cos_1.cpp | 16 +-- test/doc/math/regular/cosh_1.cpp | 16 +-- test/doc/math/regular/egamma_sqr.cpp | 16 +-- test/doc/math/regular/exp_pi.cpp | 16 +-- .../math/regular/extreme_value_skewness.cpp | 39 ------- test/doc/math/regular/four_minus_pi.cpp | 16 +-- test/doc/math/regular/four_pio_3.cpp | 16 +-- test/doc/math/regular/glaisher.cpp | 16 +-- test/doc/math/regular/inv_2pi.cpp | 16 +-- test/doc/math/regular/inv_e.cpp | 16 +-- test/doc/math/regular/inv_egamma.cpp | 4 +- test/doc/math/regular/invcbrt_pi.cpp | 16 +-- test/doc/math/regular/invlog10_e.cpp | 16 +-- test/doc/math/regular/invlog_phi.cpp | 16 +-- test/doc/math/regular/khinchin.cpp | 16 +-- test/doc/math/regular/log_phi.cpp | 16 +-- test/doc/math/regular/loglog_2.cpp | 16 +-- test/doc/math/regular/pi2.cpp | 16 +-- test/doc/math/regular/pi2o_16.cpp | 16 +-- test/doc/math/regular/pi2o_6.cpp | 16 +-- test/doc/math/regular/pi3.cpp | 16 +-- test/doc/math/regular/pi_minus_3.cpp | 16 +-- test/doc/math/regular/pi_pow_e.cpp | 16 +-- test/doc/math/regular/pio_3.cpp | 16 +-- test/doc/math/regular/pio_6.cpp | 16 +-- test/doc/math/regular/quarter.cpp | 16 +-- test/doc/math/regular/rayleigh_kurtosis.cpp | 39 ------- .../math/regular/rayleigh_kurtosis_excess.cpp | 39 ------- test/doc/math/regular/rayleigh_skewness.cpp | 39 ------- test/doc/math/regular/rsqrt_2pi.cpp | 16 +-- test/doc/math/regular/rsqrt_e.cpp | 16 +-- test/doc/math/regular/sin_1.cpp | 16 +-- test/doc/math/regular/sinh_1.cpp | 16 +-- test/doc/math/regular/sixth.cpp | 16 +-- test/doc/math/regular/sqrt_2.cpp | 16 +-- test/doc/math/regular/sqrt_2pi.cpp | 16 +-- test/doc/math/regular/sqrt_3.cpp | 16 +-- test/doc/math/regular/sqrt_e.cpp | 16 +-- test/doc/math/regular/sqrt_pi.cpp | 16 +-- test/doc/math/regular/sqrt_pio_2.cpp | 16 +-- test/doc/math/regular/sqrtlog_4.cpp | 16 +-- test/doc/math/regular/third.cpp | 16 +-- test/doc/math/regular/three_o_4.cpp | 16 +-- test/doc/math/regular/three_pio_4.cpp | 16 +-- test/doc/math/regular/two_o_3.cpp | 16 +-- test/doc/math/regular/two_o_sqrt_pi.cpp | 16 +-- test/doc/math/regular/two_pio_3.cpp | 16 +-- test/doc/math/regular/zeta_2.cpp | 16 +-- test/doc/math/regular/zeta_3.cpp | 16 +-- test/test.hpp | 24 +++++ test/unit/CMakeLists.txt | 1 + test/unit/module/math/constant/catalan.cpp | 63 +++++++++++ test/unit/module/math/constant/cbrt_pi.cpp | 63 +++++++++++ test/unit/module/math/constant/cos_1.cpp | 63 +++++++++++ test/unit/module/math/constant/cosh_1.cpp | 63 +++++++++++ test/unit/module/math/constant/egamma.cpp | 70 ++++++++++++ test/unit/module/math/constant/egamma_sqr.cpp | 63 +++++++++++ test/unit/module/math/constant/epso_2.cpp | 63 +++++++++++ test/unit/module/math/constant/euler.cpp | 70 ++++++++++++ test/unit/module/math/constant/exp_pi.cpp | 63 +++++++++++ .../module/math/constant/four_minus_pi.cpp | 63 +++++++++++ test/unit/module/math/constant/four_pio_3.cpp | 63 +++++++++++ test/unit/module/math/constant/glaisher.cpp | 63 +++++++++++ test/unit/module/math/constant/inv_2eps.cpp | 63 +++++++++++ test/unit/module/math/constant/inv_2pi.cpp | 63 +++++++++++ test/unit/module/math/constant/inv_e.cpp | 63 +++++++++++ test/unit/module/math/constant/inv_egamma.cpp | 63 +++++++++++ test/unit/module/math/constant/inv_pi.cpp | 63 +++++++++++ test/unit/module/math/constant/invcbrt_pi.cpp | 63 +++++++++++ .../module/math/{ => constant}/invlog10_2.cpp | 38 +++++-- test/unit/module/math/constant/invlog10_e.cpp | 63 +++++++++++ .../module/math/{ => constant}/invlog_10.cpp | 40 +++++-- test/unit/module/math/constant/invlog_2.cpp | 72 +++++++++++++ test/unit/module/math/constant/invlog_phi.cpp | 63 +++++++++++ test/unit/module/math/constant/invsqrt_2.cpp | 72 +++++++++++++ test/unit/module/math/constant/khinchin.cpp | 63 +++++++++++ test/unit/module/math/constant/log10_e.cpp | 71 ++++++++++++ test/unit/module/math/constant/log2_e.cpp | 70 ++++++++++++ test/unit/module/math/constant/log_10.cpp | 70 ++++++++++++ test/unit/module/math/constant/log_2.cpp | 70 ++++++++++++ test/unit/module/math/constant/log_phi.cpp | 63 +++++++++++ test/unit/module/math/constant/loglog_2.cpp | 63 +++++++++++ test/unit/module/math/constant/maxlog.cpp | 63 +++++++++++ test/unit/module/math/constant/maxlog10.cpp | 63 +++++++++++ test/unit/module/math/constant/maxlog2.cpp | 63 +++++++++++ test/unit/module/math/constant/minlog.cpp | 64 +++++++++++ test/unit/module/math/constant/minlog10.cpp | 67 ++++++++++++ .../module/math/constant/minlog10denormal.cpp | 65 +++++++++++ test/unit/module/math/constant/minlog2.cpp | 63 +++++++++++ .../module/math/constant/minlog2denormal.cpp | 62 +++++++++++ .../module/math/constant/minlogdenormal.cpp | 63 +++++++++++ test/unit/module/math/constant/phi.cpp | 68 ++++++++++++ test/unit/module/math/constant/pi.cpp | 69 ++++++++++++ test/unit/module/math/constant/pi2.cpp | 63 +++++++++++ test/unit/module/math/constant/pi2o_16.cpp | 63 +++++++++++ test/unit/module/math/constant/pi2o_6.cpp | 63 +++++++++++ test/unit/module/math/constant/pi3.cpp | 63 +++++++++++ test/unit/module/math/constant/pi_minus_3.cpp | 63 +++++++++++ test/unit/module/math/constant/pi_pow_e.cpp | 63 +++++++++++ test/unit/module/math/constant/pio_2.cpp | 70 ++++++++++++ test/unit/module/math/constant/pio_3.cpp | 63 +++++++++++ test/unit/module/math/constant/pio_4.cpp | 70 ++++++++++++ test/unit/module/math/constant/pio_6.cpp | 63 +++++++++++ test/unit/module/math/constant/quarter.cpp | 63 +++++++++++ test/unit/module/math/constant/rsqrt_2pi.cpp | 63 +++++++++++ test/unit/module/math/constant/rsqrt_e.cpp | 63 +++++++++++ .../module/math/{ => constant}/rsqrt_pi.cpp | 38 +++++-- .../unit/module/math/constant/rsqrt_pio_2.cpp | 63 +++++++++++ test/unit/module/math/constant/sin_1.cpp | 63 +++++++++++ test/unit/module/math/constant/sinh_1.cpp | 63 +++++++++++ test/unit/module/math/constant/sixth.cpp | 63 +++++++++++ test/unit/module/math/constant/sqrt_2.cpp | 72 +++++++++++++ test/unit/module/math/constant/sqrt_2pi.cpp | 63 +++++++++++ test/unit/module/math/constant/sqrt_3.cpp | 73 +++++++++++++ test/unit/module/math/constant/sqrt_e.cpp | 63 +++++++++++ test/unit/module/math/constant/sqrt_pi.cpp | 63 +++++++++++ test/unit/module/math/constant/sqrt_pio_2.cpp | 63 +++++++++++ test/unit/module/math/constant/sqrtlog_4.cpp | 63 +++++++++++ test/unit/module/math/constant/third.cpp | 63 +++++++++++ test/unit/module/math/constant/three_o_4.cpp | 63 +++++++++++ .../unit/module/math/constant/three_pio_4.cpp | 63 +++++++++++ test/unit/module/math/constant/two_o_3.cpp | 63 +++++++++++ test/unit/module/math/constant/two_o_pi.cpp | 64 +++++++++++ .../module/math/constant/two_o_sqrt_pi.cpp | 63 +++++++++++ test/unit/module/math/constant/two_pi.cpp | 64 +++++++++++ test/unit/module/math/constant/two_pio_3.cpp | 63 +++++++++++ test/unit/module/math/constant/zeta_2.cpp | 63 +++++++++++ test/unit/module/math/constant/zeta_3.cpp | 63 +++++++++++ test/unit/module/math/egamma.cpp | 48 --------- test/unit/module/math/euler.cpp | 48 --------- test/unit/module/math/exp.cpp | 4 +- test/unit/module/math/exp10.cpp | 20 ++-- test/unit/module/math/exp2.cpp | 6 +- test/unit/module/math/invlog_2.cpp | 51 --------- test/unit/module/math/invpi.cpp | 48 --------- test/unit/module/math/invsqrt_2.cpp | 49 --------- test/unit/module/math/log10_e.cpp | 49 --------- test/unit/module/math/log2_e.cpp | 48 --------- test/unit/module/math/log_10.cpp | 48 --------- test/unit/module/math/log_2.cpp | 48 --------- test/unit/module/math/maxlog.cpp | 38 ------- test/unit/module/math/maxlog10.cpp | 38 ------- test/unit/module/math/maxlog2.cpp | 38 ------- test/unit/module/math/minlog.cpp | 38 ------- test/unit/module/math/minlog10.cpp | 38 ------- test/unit/module/math/minlog10denormal.cpp | 40 ------- test/unit/module/math/minlog2.cpp | 38 ------- test/unit/module/math/minlog2denormal.cpp | 40 ------- test/unit/module/math/minlogdenormal.cpp | 37 ------- test/unit/module/math/phi.cpp | 50 --------- test/unit/module/math/pi.cpp | 47 -------- test/unit/module/math/pio_2.cpp | 48 --------- test/unit/module/math/pio_4.cpp | 48 --------- test/unit/module/math/sqrt_2.cpp | 48 --------- test/unit/module/math/sqrt_3.cpp | 48 --------- test/unit/module/math/two_o_pi.cpp | 42 -------- test/unit/module/math/two_pi.cpp | 42 -------- 249 files changed, 7823 insertions(+), 4149 deletions(-) delete mode 100644 test/doc/math/regular/extreme_value_skewness.cpp delete mode 100644 test/doc/math/regular/rayleigh_kurtosis.cpp delete mode 100644 test/doc/math/regular/rayleigh_kurtosis_excess.cpp delete mode 100644 test/doc/math/regular/rayleigh_skewness.cpp create mode 100644 test/unit/module/math/constant/catalan.cpp create mode 100644 test/unit/module/math/constant/cbrt_pi.cpp create mode 100644 test/unit/module/math/constant/cos_1.cpp create mode 100644 test/unit/module/math/constant/cosh_1.cpp create mode 100644 test/unit/module/math/constant/egamma.cpp create mode 100644 test/unit/module/math/constant/egamma_sqr.cpp create mode 100644 test/unit/module/math/constant/epso_2.cpp create mode 100644 test/unit/module/math/constant/euler.cpp create mode 100644 test/unit/module/math/constant/exp_pi.cpp create mode 100644 test/unit/module/math/constant/four_minus_pi.cpp create mode 100644 test/unit/module/math/constant/four_pio_3.cpp create mode 100644 test/unit/module/math/constant/glaisher.cpp create mode 100644 test/unit/module/math/constant/inv_2eps.cpp create mode 100644 test/unit/module/math/constant/inv_2pi.cpp create mode 100644 test/unit/module/math/constant/inv_e.cpp create mode 100644 test/unit/module/math/constant/inv_egamma.cpp create mode 100644 test/unit/module/math/constant/inv_pi.cpp create mode 100644 test/unit/module/math/constant/invcbrt_pi.cpp rename test/unit/module/math/{ => constant}/invlog10_2.cpp (51%) create mode 100644 test/unit/module/math/constant/invlog10_e.cpp rename test/unit/module/math/{ => constant}/invlog_10.cpp (52%) create mode 100644 test/unit/module/math/constant/invlog_2.cpp create mode 100644 test/unit/module/math/constant/invlog_phi.cpp create mode 100644 test/unit/module/math/constant/invsqrt_2.cpp create mode 100644 test/unit/module/math/constant/khinchin.cpp create mode 100644 test/unit/module/math/constant/log10_e.cpp create mode 100644 test/unit/module/math/constant/log2_e.cpp create mode 100644 test/unit/module/math/constant/log_10.cpp create mode 100644 test/unit/module/math/constant/log_2.cpp create mode 100644 test/unit/module/math/constant/log_phi.cpp create mode 100644 test/unit/module/math/constant/loglog_2.cpp create mode 100644 test/unit/module/math/constant/maxlog.cpp create mode 100644 test/unit/module/math/constant/maxlog10.cpp create mode 100644 test/unit/module/math/constant/maxlog2.cpp create mode 100644 test/unit/module/math/constant/minlog.cpp create mode 100644 test/unit/module/math/constant/minlog10.cpp create mode 100644 test/unit/module/math/constant/minlog10denormal.cpp create mode 100644 test/unit/module/math/constant/minlog2.cpp create mode 100644 test/unit/module/math/constant/minlog2denormal.cpp create mode 100644 test/unit/module/math/constant/minlogdenormal.cpp create mode 100644 test/unit/module/math/constant/phi.cpp create mode 100644 test/unit/module/math/constant/pi.cpp create mode 100644 test/unit/module/math/constant/pi2.cpp create mode 100644 test/unit/module/math/constant/pi2o_16.cpp create mode 100644 test/unit/module/math/constant/pi2o_6.cpp create mode 100644 test/unit/module/math/constant/pi3.cpp create mode 100644 test/unit/module/math/constant/pi_minus_3.cpp create mode 100644 test/unit/module/math/constant/pi_pow_e.cpp create mode 100644 test/unit/module/math/constant/pio_2.cpp create mode 100644 test/unit/module/math/constant/pio_3.cpp create mode 100644 test/unit/module/math/constant/pio_4.cpp create mode 100644 test/unit/module/math/constant/pio_6.cpp create mode 100644 test/unit/module/math/constant/quarter.cpp create mode 100644 test/unit/module/math/constant/rsqrt_2pi.cpp create mode 100644 test/unit/module/math/constant/rsqrt_e.cpp rename test/unit/module/math/{ => constant}/rsqrt_pi.cpp (52%) create mode 100644 test/unit/module/math/constant/rsqrt_pio_2.cpp create mode 100644 test/unit/module/math/constant/sin_1.cpp create mode 100644 test/unit/module/math/constant/sinh_1.cpp create mode 100644 test/unit/module/math/constant/sixth.cpp create mode 100644 test/unit/module/math/constant/sqrt_2.cpp create mode 100644 test/unit/module/math/constant/sqrt_2pi.cpp create mode 100644 test/unit/module/math/constant/sqrt_3.cpp create mode 100644 test/unit/module/math/constant/sqrt_e.cpp create mode 100644 test/unit/module/math/constant/sqrt_pi.cpp create mode 100644 test/unit/module/math/constant/sqrt_pio_2.cpp create mode 100644 test/unit/module/math/constant/sqrtlog_4.cpp create mode 100644 test/unit/module/math/constant/third.cpp create mode 100644 test/unit/module/math/constant/three_o_4.cpp create mode 100644 test/unit/module/math/constant/three_pio_4.cpp create mode 100644 test/unit/module/math/constant/two_o_3.cpp create mode 100644 test/unit/module/math/constant/two_o_pi.cpp create mode 100644 test/unit/module/math/constant/two_o_sqrt_pi.cpp create mode 100644 test/unit/module/math/constant/two_pi.cpp create mode 100644 test/unit/module/math/constant/two_pio_3.cpp create mode 100644 test/unit/module/math/constant/zeta_2.cpp create mode 100644 test/unit/module/math/constant/zeta_3.cpp delete mode 100644 test/unit/module/math/egamma.cpp delete mode 100644 test/unit/module/math/euler.cpp delete mode 100644 test/unit/module/math/invlog_2.cpp delete mode 100644 test/unit/module/math/invpi.cpp delete mode 100644 test/unit/module/math/invsqrt_2.cpp delete mode 100644 test/unit/module/math/log10_e.cpp delete mode 100644 test/unit/module/math/log2_e.cpp delete mode 100644 test/unit/module/math/log_10.cpp delete mode 100644 test/unit/module/math/log_2.cpp delete mode 100644 test/unit/module/math/maxlog.cpp delete mode 100644 test/unit/module/math/maxlog10.cpp delete mode 100644 test/unit/module/math/maxlog2.cpp delete mode 100644 test/unit/module/math/minlog.cpp delete mode 100644 test/unit/module/math/minlog10.cpp delete mode 100644 test/unit/module/math/minlog10denormal.cpp delete mode 100644 test/unit/module/math/minlog2.cpp delete mode 100644 test/unit/module/math/minlog2denormal.cpp delete mode 100644 test/unit/module/math/minlogdenormal.cpp delete mode 100644 test/unit/module/math/phi.cpp delete mode 100644 test/unit/module/math/pi.cpp delete mode 100644 test/unit/module/math/pio_2.cpp delete mode 100644 test/unit/module/math/pio_4.cpp delete mode 100644 test/unit/module/math/sqrt_2.cpp delete mode 100644 test/unit/module/math/sqrt_3.cpp delete mode 100644 test/unit/module/math/two_o_pi.cpp delete mode 100644 test/unit/module/math/two_pi.cpp diff --git a/include/eve/module/core/constant/allbits.hpp b/include/eve/module/core/constant/allbits.hpp index 171c2f3e83..92e8e6db23 100644 --- a/include/eve/module/core/constant/allbits.hpp +++ b/include/eve/module/core/constant/allbits.hpp @@ -7,21 +7,38 @@ //================================================================================================== #pragma once -#include -#include -#include -#include -#include - -#include +#include +#include +#include namespace eve { +template +struct allbits_t : constant_callable +{ + template + static EVE_FORCEINLINE T value(eve::as const&, auto const&) + { + using e_t = element_type_t; + using i_t = as_integer_t; + constexpr auto mask = ~0ULL; + + if constexpr( std::integral ) return T(mask); + else return T(bit_cast(i_t(mask), as())); + } + + template + requires(plain_scalar_value>) + EVE_FORCEINLINE T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(allbits_t, allbits_); +}; + //================================================================================================ //! @addtogroup core_constants //! @{ //! @var allbits -//! @brief Computes the constant with all bits set. +//! @brief Computes a constant with all bits set. //! //! **Defined in Header** //! @@ -34,8 +51,7 @@ namespace eve //! @code //! namespace eve //! { -//! template< eve::value T > -//! T allbits(as x) noexcept; +//! template constexpr T allbits(as x) noexcept; //! } //! @endcode //! @@ -43,37 +59,17 @@ namespace eve //! //! * `x` : [Type wrapper](@ref eve::as) instance embedding the type of the constant. //! -//! **Return value** +//! **Return value** //! -//! The call `eve::allbits(as())` returns a value of type T with all bits set. +//! The call `eve::allbits(as())` returns a value of type `T` with all bits set. //! -//! @groupheader{Example} +//! @groupheader{Example} //! -//! @godbolt{doc/core/constant/allbits.cpp} +//! @godbolt{doc/core/constant/allbits.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(allbits_, allbits); +inline constexpr auto allbits = functor; -namespace detail -{ - template - requires(plain_scalar_value>) - EVE_FORCEINLINE constexpr auto allbits_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - using i_t = as_integer_t; - constexpr auto mask = ~0ULL; - - if constexpr( std::is_integral_v ) return T(mask); - else return T(bit_cast(i_t(mask), as())); - } - - template - requires(is_one_of(types {})) - EVE_FORCEINLINE constexpr auto allbits_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - -> decltype(allbits(as())) - { - return allbits(as()); - } -} +// Required for if_else optimisation detections +using callable_allbits_ = tag_t; } diff --git a/include/eve/module/core/constant/bitincrement.hpp b/include/eve/module/core/constant/bitincrement.hpp index e64546f4b4..bf69d97569 100644 --- a/include/eve/module/core/constant/bitincrement.hpp +++ b/include/eve/module/core/constant/bitincrement.hpp @@ -7,22 +7,37 @@ //================================================================================================== #pragma once -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include namespace eve { +template +struct bitincrement_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, auto const&) + { + using e_t = element_type_t; + + if constexpr(std::integral ) return T(1); + else if constexpr(std::same_as ) return T(0x1p-149); + else if constexpr(std::same_as ) return T(0x0.0000000000001p-1022); + } + + template + requires(plain_scalar_value>) + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(bitincrement_t, bitincrement_); +}; + //================================================================================================ //! @addtogroup core_constants //! @{ //! @var bitincrement -//! @brief Computes the constant of type T in which the only bit set is the least significant +//! @brief Computes a constant with only the least significant bit set. //! //! **Defined in Header** //! @@ -35,8 +50,7 @@ namespace eve //! @code //! namespace eve //! { -//! template< eve::value T > -//! T bitincrement(as x) noexcept; +//! template< eve::value T > constexpr T bitincrement(as x) noexcept; //! } //! @endcode //! @@ -44,37 +58,15 @@ namespace eve //! //! * `x` : [Type wrapper](@ref eve::as) instance embedding the type of the constant. //! -//! **Return value** +//! **Return value** //! -//! The call `eve::bitincrement(as())` returns a value of type T in which the only bit -//! set is the least significant +//! The call `eve::bitincrement(as())` returns a value of type `T` with only the least significant +//! bit set. //! -//! @groupheader{Example} +//! @groupheader{Example} //! -//! @godbolt{doc/core/constant/bitincrement.cpp} +//! @godbolt{doc/core/constant/bitincrement.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(bitincrement_, bitincrement); - -namespace detail -{ - template - requires(plain_scalar_value>) - EVE_FORCEINLINE constexpr auto bitincrement_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_integral_v ) return T(1); - else if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - requires(is_one_of(types {})) - EVE_FORCEINLINE constexpr auto bitincrement_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - -> decltype(bitincrement(as())) - { - return bitincrement(as()); - } -} +inline constexpr auto bitincrement = functor; } diff --git a/include/eve/module/core/constant/eps.hpp b/include/eve/module/core/constant/eps.hpp index f93c8bc34b..cf5e57d3ed 100644 --- a/include/eve/module/core/constant/eps.hpp +++ b/include/eve/module/core/constant/eps.hpp @@ -7,22 +7,37 @@ //================================================================================================== #pragma once -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include namespace eve { +template +struct eps_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, auto const&) + { + using e_t = element_type_t; + + if constexpr(std::integral ) return T(1); + else if constexpr(std::same_as ) return T(0x1p-23); + else if constexpr(std::same_as ) return T(0x1p-52); + } + + template + requires(plain_scalar_value>) + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(eps_t, eps_); +}; + //================================================================================================ //! @addtogroup core_constants //! @{ //! @var eps -//! @brief Computes the the machine epsilon. +//! @brief Computes a constant to the machine epsilon. //! //! **Defined in Header** //! @@ -35,8 +50,7 @@ namespace eve //! @code //! namespace eve //! { -//! template< eve::value T > -//! T $name$(as x) noexcept; +//! template constexpr T eps(as x) noexcept; //! } //! @endcode //! @@ -44,43 +58,20 @@ namespace eve //! //! * `x` : [Type wrapper](@ref eve::as) instance embedding the type of the constant. //! -//! **Return value** +//! **Return value** //! -//! the call `eve::eps(as())` returns [elementwise](@ref glossary_elementwise), the smallest -//! positive value `x` of the type such that `1+x != x`. +//! The call `eve::eps(as())` returns [elementwise](@ref glossary_elementwise), the smallest +//! positive value `x` of the type such that `1+x != x`. //! -//! * If T is an [integral value](@ref eve::integral_value) the elements returned are equal to -//! one -//! * If T is a [floating value](@ref eve::floating_value) the elements returned are equal to -//! * 2.220446049250313e-16 if the [elements type](@ref eve::element_type) is float -//! * 1.1920929e-07f if the [elements type](@ref eve::element_type) is double +//! * If T is an [integral value](@ref eve::integral_value) the elements returned are equal to one. +//! * If T is a [floating value](@ref eve::floating_value) the elements returned are equal to: +//! * 2.220446049250313e-16 if the [elements type](@ref eve::element_type) is `float`. +//! * 1.1920929e-07f if the [elements type](@ref eve::element_type) is `double`. //! -//! @groupheader{Example} +//! @groupheader{Example} //! -//! @godbolt{doc/core/constant/eps.cpp} +//! @godbolt{doc/core/constant/eps.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(eps_, eps); - -namespace detail -{ - template - requires(plain_scalar_value>) - EVE_FORCEINLINE constexpr auto eps_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_integral_v ) return T(1); - else if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - requires(is_one_of(types {})) - EVE_FORCEINLINE constexpr auto eps_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - -> decltype(eps(as())) - { - return eps(as()); - } -} +inline constexpr auto eps = functor; } diff --git a/include/eve/module/core/constant/false.hpp b/include/eve/module/core/constant/false.hpp index a8d627c415..31c781069a 100644 --- a/include/eve/module/core/constant/false.hpp +++ b/include/eve/module/core/constant/false.hpp @@ -7,17 +7,33 @@ //================================================================================================== #pragma once -#include -#include +#include #include +#include +#include namespace eve { +template +struct false_t : constant_callable +{ + template + static EVE_FORCEINLINE auto value(eve::as const&, auto const&) + { + return as_logical_t(false); + } + + template + EVE_FORCEINLINE as_logical_t operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(false_t, false__); +}; + //================================================================================================ //! @addtogroup core_constants //! @{ //! @var false_ -//! @brief Computes the false logical value. +//! @brief Computes the false logical value. //! //! **Defined in Header** //! @@ -30,8 +46,7 @@ namespace eve //! @code //! namespace eve //! { -//! template< eve::value T > -//! eve::as_logical false_(as x) noexcept; +//! template constexpr eve::as_logical false_(as x) noexcept; //! } //! @endcode //! @@ -39,24 +54,14 @@ namespace eve //! //! * `x` : [Type wrapper](@ref eve::as) instance embedding the type of the constant. //! -//! **Return value** +//! **Return value** //! -//! the call `eve::false_(as())` returns [elementwise](@ref glossary_elementwise), the false -//! logical value. +//! The call `eve::false_(as())` returns the `false` logical value for type `T`. //! -//! @groupheader{Example} +//! @groupheader{Example} //! -//! @godbolt{doc/core/constant/false_.cpp} +//! @godbolt{doc/core/constant/false_.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(false__, false_); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr as_logical_t false__(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return as_logical_t(false); - } -} +inline constexpr auto false_ = functor; } diff --git a/include/eve/module/core/decorator/core.hpp b/include/eve/module/core/decorator/core.hpp index 20cc7cf5fe..7723123f0d 100644 --- a/include/eve/module/core/decorator/core.hpp +++ b/include/eve/module/core/decorator/core.hpp @@ -33,6 +33,7 @@ namespace eve struct almost_mode {}; struct compensated_mode {}; struct definitely_mode {}; + struct downward_mode {}; struct kind_1_mode {}; struct kind_2_mode {}; struct musl_mode {}; @@ -47,62 +48,56 @@ namespace eve struct saturated_mode {}; struct spherical_mode {}; struct successor_mode {}; + struct to_nearest_mode {}; struct tolerant_mode {}; + struct toward_zero_mode {}; + struct upward_mode {}; - struct rounding_key_t : rbr::as_keyword - { - template constexpr auto operator=(Value const&) const noexcept - { - return rbr::option{}; - } - }; - [[maybe_unused]] inline constexpr rounding_key_t rounding_key = {}; + [[maybe_unused]] inline constexpr auto almost2 = ::rbr::flag( almost_mode{} ); + [[maybe_unused]] inline constexpr auto compensated2 = ::rbr::flag( compensated_mode{} ); + [[maybe_unused]] inline constexpr auto definitely2 = ::rbr::flag( definitely_mode{} ); + [[maybe_unused]] inline constexpr auto downward2 = ::rbr::flag( downward_mode{} ); + [[maybe_unused]] inline constexpr auto kind_12 = ::rbr::flag( kind_1_mode{} ); + [[maybe_unused]] inline constexpr auto kind_22 = ::rbr::flag( kind_2_mode{} ); + [[maybe_unused]] inline constexpr auto musl2 = ::rbr::flag( musl_mode{} ); + [[maybe_unused]] inline constexpr auto numeric2 = ::rbr::flag( numeric_mode{} ); + [[maybe_unused]] inline constexpr auto p_kind2 = ::rbr::flag( p_kind_mode{} ); + [[maybe_unused]] inline constexpr auto pedantic2 = ::rbr::flag( pedantic_mode{} ); + [[maybe_unused]] inline constexpr auto plain2 = ::rbr::flag( plain_mode{} ); + [[maybe_unused]] inline constexpr auto promote2 = ::rbr::flag( promote_mode{} ); + [[maybe_unused]] inline constexpr auto q_kind2 = ::rbr::flag( q_kind_mode{} ); + [[maybe_unused]] inline constexpr auto raw2 = ::rbr::flag( raw_mode{} ); + [[maybe_unused]] inline constexpr auto regular2 = ::rbr::flag( regular_mode{} ); + [[maybe_unused]] inline constexpr auto saturated2 = ::rbr::flag( saturated_mode{} ); + [[maybe_unused]] inline constexpr auto spherical = ::rbr::flag( spherical_mode{} ); + [[maybe_unused]] inline constexpr auto successor2 = ::rbr::flag( successor_mode{} ); + [[maybe_unused]] inline constexpr auto to_nearest2 = ::rbr::flag( to_nearest_mode{} ); + [[maybe_unused]] inline constexpr auto tolerant2 = ::rbr::flag( tolerant_mode{} ); + [[maybe_unused]] inline constexpr auto toward_zero2 = ::rbr::flag( toward_zero_mode{} ); + [[maybe_unused]] inline constexpr auto upward2 = ::rbr::flag( upward_mode{} ); - template - [[maybe_unused]] inline constexpr auto rounding = (rounding_key = eve::index); - - [[maybe_unused]] inline constexpr auto almost2 = ::rbr::flag( almost_mode{} ); - [[maybe_unused]] inline constexpr auto compensated2 = ::rbr::flag( compensated_mode{}); - [[maybe_unused]] inline constexpr auto definitely2 = ::rbr::flag( definitely_mode{}); - [[maybe_unused]] inline constexpr auto downward2 = rounding<(0x01 | 0x08)>; - [[maybe_unused]] inline constexpr auto kind_12 = ::rbr::flag( kind_1_mode{} ); - [[maybe_unused]] inline constexpr auto kind_22 = ::rbr::flag( kind_2_mode{} ); - [[maybe_unused]] inline constexpr auto musl2 = ::rbr::flag( musl_mode{} ); - [[maybe_unused]] inline constexpr auto numeric2 = ::rbr::flag( numeric_mode{} ); - [[maybe_unused]] inline constexpr auto p_kind2 = ::rbr::flag( p_kind_mode{} ); - [[maybe_unused]] inline constexpr auto pedantic2 = ::rbr::flag( pedantic_mode{} ); - [[maybe_unused]] inline constexpr auto plain2 = ::rbr::flag( plain_mode{} ); - [[maybe_unused]] inline constexpr auto promote2 = ::rbr::flag( promote_mode{} ); - [[maybe_unused]] inline constexpr auto q_kind2 = ::rbr::flag( q_kind_mode{} ); - [[maybe_unused]] inline constexpr auto raw2 = ::rbr::flag( raw_mode{} ); - [[maybe_unused]] inline constexpr auto regular2 = ::rbr::flag( regular_mode{} ); - [[maybe_unused]] inline constexpr auto saturated2 = ::rbr::flag( saturated_mode{} ); - [[maybe_unused]] inline constexpr auto spherical = ::rbr::flag( spherical_mode{} ); - [[maybe_unused]] inline constexpr auto successor2 = ::rbr::flag( successor_mode{} ); - [[maybe_unused]] inline constexpr auto to_nearest2 = rounding<(0x00 | 0x08)>; - [[maybe_unused]] inline constexpr auto tolerant2 = ::rbr::flag( tolerant_mode{} ); - [[maybe_unused]] inline constexpr auto toward_zero2 = rounding<(0x03 | 0x08)>; - [[maybe_unused]] inline constexpr auto upward2 = rounding<(0x02 | 0x08)>; - - struct almost_option : detail::exact_option {}; - struct compensated_option : detail::exact_option {}; - struct definitely_option : detail::exact_option {}; - struct kind_1_option : detail::exact_option {}; - struct kind_2_option : detail::exact_option {}; - struct musl_option : detail::exact_option {}; - struct numeric_option : detail::exact_option {}; - struct p_kind_option : detail::exact_option {}; - struct pedantic_option : detail::exact_option {}; - struct plain_option : detail::exact_option {}; - struct promote_option : detail::exact_option {}; - struct q_kind_option : detail::exact_option {}; - struct raw_option : detail::exact_option {}; - struct regular_option : detail::exact_option {}; - struct rounding_option : detail::exact_option {}; - struct saturated_option : detail::exact_option {}; - struct spherical_option : detail::exact_option {}; - struct successor_option : detail::exact_option {}; - struct tolerant_option : detail::exact_option {}; + struct almost_option : detail::exact_option {}; + struct compensated_option : detail::exact_option {}; + struct definitely_option : detail::exact_option {}; + struct downward_option : detail::exact_option {}; + struct kind_1_option : detail::exact_option {}; + struct kind_2_option : detail::exact_option {}; + struct musl_option : detail::exact_option {}; + struct numeric_option : detail::exact_option {}; + struct p_kind_option : detail::exact_option {}; + struct pedantic_option : detail::exact_option {}; + struct plain_option : detail::exact_option {}; + struct promote_option : detail::exact_option {}; + struct q_kind_option : detail::exact_option {}; + struct raw_option : detail::exact_option {}; + struct regular_option : detail::exact_option {}; + struct saturated_option : detail::exact_option {}; + struct spherical_option : detail::exact_option {}; + struct successor_option : detail::exact_option {}; + struct to_nearest_option : detail::exact_option {}; + struct tolerant_option : detail::exact_option {}; + struct toward_zero_option : detail::exact_option {}; + struct upward_option : detail::exact_option {}; // ---------------------------------------------------------------------------------- // [TEMPORARY] Will be removed when all decorator have been converted diff --git a/include/eve/module/core/decorator/roundings.hpp b/include/eve/module/core/decorator/roundings.hpp index e78c5d9917..cef8919797 100644 --- a/include/eve/module/core/decorator/roundings.hpp +++ b/include/eve/module/core/decorator/roundings.hpp @@ -157,8 +157,8 @@ using to_nearest_type = decorated; //================================================================================================ using toward_zero_type = decorated; -inline constexpr upward_type const upward = {}; -inline constexpr downward_type const downward = {}; -inline constexpr to_nearest_type const to_nearest = {}; -inline constexpr toward_zero_type const toward_zero = {}; +[[maybe_unused]] inline constexpr upward_type const upward = {}; +[[maybe_unused]] inline constexpr downward_type const downward = {}; +[[maybe_unused]] inline constexpr to_nearest_type const to_nearest = {}; +[[maybe_unused]] inline constexpr toward_zero_type const toward_zero = {}; } diff --git a/include/eve/module/math/constant/catalan.hpp b/include/eve/module/math/constant/catalan.hpp index a3d7a6aa10..05ca3a5418 100644 --- a/include/eve/module/math/constant/catalan.hpp +++ b/include/eve/module/math/constant/catalan.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct catalan_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.d4f972p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.d4f97p-1); + else return T(0x1.d4f972p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.d4f9713e8135ep-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.d4f9713e8135dp-1); + else return T(0x1.d4f9713e8135dp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(catalan_t, catalan_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -48,33 +76,5 @@ namespace eve //! @godbolt{doc/math/regular/catalan.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(catalan_, catalan); - -namespace detail -{ - template - EVE_FORCEINLINE T catalan_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.d4f972p-1); - else if constexpr( std::is_same_v ) return T(0x1.d4f9713e8135dp-1); - } - - template - EVE_FORCEINLINE constexpr T catalan_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.d4f972p-1); - else if constexpr( std::is_same_v ) return T(0x1.d4f9713e8135ep-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.d4f97p-1); - else if constexpr( std::is_same_v ) return T(0x1.d4f9713e8135dp-1); - } - } -} +inline constexpr auto catalan = functor; } diff --git a/include/eve/module/math/constant/cbrt_pi.hpp b/include/eve/module/math/constant/cbrt_pi.hpp index a55aa83471..486ccd7d81 100644 --- a/include/eve/module/math/constant/cbrt_pi.hpp +++ b/include/eve/module/math/constant/cbrt_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct cbrt_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.76ef8p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.76ef7ep+0); + else return T(0x1.76ef7ep+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.76ef7e73104b8p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.76ef7e73104b7p+0); + else return T(0x1.76ef7e73104b8p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(cbrt_pi_t, cbrt_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/cbrt_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(cbrt_pi_, cbrt_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto cbrt_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.76ef7ep+0); - else if constexpr( std::is_same_v ) return T(0x1.76ef7e73104b8p+0); - } - - template - EVE_FORCEINLINE constexpr auto cbrt_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.76ef8p+0); - else if constexpr( std::is_same_v ) return T(0x1.76ef7e73104b8p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.76ef7ep+0); - else if constexpr( std::is_same_v ) return T(0x1.76ef7e73104b7p+0); - } - } -} +inline constexpr auto cbrt_pi = functor; } diff --git a/include/eve/module/math/constant/cos_1.hpp b/include/eve/module/math/constant/cos_1.hpp index 760c265003..1e78cdf807 100644 --- a/include/eve/module/math/constant/cos_1.hpp +++ b/include/eve/module/math/constant/cos_1.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct cos_1_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.14a282p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.14a28p-1); + else return T(0x1.14a28p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.14a280fb5068cp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.14a280fb5068bp-1); + else return T(0x1.14a280fb5068cp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(cos_1_t, cos_1_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/cos_1.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(cos_1_, cos_1); - -namespace detail -{ - template - EVE_FORCEINLINE auto cos_1_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.14a28p-1); - else if constexpr( std::is_same_v ) return T(0x1.14a280fb5068cp-1); - } - - template - EVE_FORCEINLINE constexpr auto cos_1_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.14a282p-1); - else if constexpr( std::is_same_v ) return T(0x1.14a280fb5068cp-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.14a28p-1); - else if constexpr( std::is_same_v ) return T(0x1.14a280fb5068bp-1); - } - } -} +inline constexpr auto cos_1 = functor; } diff --git a/include/eve/module/math/constant/cosh_1.hpp b/include/eve/module/math/constant/cosh_1.hpp index 97a7c7c6be..14dc7e0013 100644 --- a/include/eve/module/math/constant/cosh_1.hpp +++ b/include/eve/module/math/constant/cosh_1.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct cosh_1_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.8b0756p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.8b0754p+0); + else return T(0x1.8b0756p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.8b07551d9f551p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.8b07551d9f55p+0); + else return T(0x1.8b07551d9f55p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(cosh_1_t, cosh_1_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/cosh_1.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(cosh_1_, cosh_1); - -namespace detail -{ - template - EVE_FORCEINLINE auto cosh_1_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.8b0756p+0); - else if constexpr( std::is_same_v ) return T(0x1.8b07551d9f55p+0); - } - - template - EVE_FORCEINLINE constexpr auto cosh_1_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.8b0756p+0); - else if constexpr( std::is_same_v ) return T(0x1.8b07551d9f551p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.8b0754p+0); - else if constexpr( std::is_same_v ) return T(0x1.8b07551d9f55p+0); - } - } -} +inline constexpr auto cosh_1 = functor; } diff --git a/include/eve/module/math/constant/egamma.hpp b/include/eve/module/math/constant/egamma.hpp index b3b5118096..ae0d817c1d 100644 --- a/include/eve/module/math/constant/egamma.hpp +++ b/include/eve/module/math/constant/egamma.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct egamma_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.2788dp-1 ); + else if constexpr(Opts::contains(downward2)) return T(0x1.2788cep-1); + else return T(0x1.2788dp-1 ); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.2788cfc6fb619p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.2788cfc6fb618p-1); + else return T(0x1.2788cfc6fb619p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(egamma_t, egamma_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -48,23 +76,5 @@ namespace eve //! @godbolt{doc/math/regular/egamma.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(egamma_, egamma); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto egamma_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant(); // 0.57721566490153286060651209008 - } - - template - EVE_FORCEINLINE constexpr auto egamma_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto egamma = functor; } diff --git a/include/eve/module/math/constant/egamma_sqr.hpp b/include/eve/module/math/constant/egamma_sqr.hpp index 857554dad1..771ab22353 100644 --- a/include/eve/module/math/constant/egamma_sqr.hpp +++ b/include/eve/module/math/constant/egamma_sqr.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct egamma_sqr_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.552c98p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.552c96p-2); + else return T(0x1.552c98p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.552c97fa03696p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.552c97fa03695p-2); + else return T(0x1.552c97fa03695p-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(egamma_sqr_t, egamma_sqr_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -48,33 +76,5 @@ namespace eve //! @godbolt{doc/math/regular/egamma_sqr.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(egamma_sqr_, egamma_sqr); - -namespace detail -{ - template - EVE_FORCEINLINE auto egamma_sqr_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.552c98p-2); - else if constexpr( std::is_same_v ) return T(0x1.552c97fa03695p-2); - } - - template - EVE_FORCEINLINE constexpr auto egamma_sqr_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.552c98p-2); - else if constexpr( std::is_same_v ) return T(0x1.552c97fa03696p-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.552c96p-2); - else if constexpr( std::is_same_v ) return T(0x1.552c97fa03695p-2); - } - } -} +inline constexpr auto egamma_sqr = functor; } diff --git a/include/eve/module/math/constant/epso_2.hpp b/include/eve/module/math/constant/epso_2.hpp index c9510f7da0..da69d129ad 100644 --- a/include/eve/module/math/constant/epso_2.hpp +++ b/include/eve/module/math/constant/epso_2.hpp @@ -7,10 +7,29 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct epso_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + using e_t = element_type_t; + if constexpr(std::same_as ) return T(0x1p-24); + else if constexpr(std::same_as ) return T(0x1p-53); + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(epso_2_t, epso_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,24 +65,5 @@ namespace eve //! @godbolt{doc/math/regular/epso_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(epso_2_, epso_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto epso_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto epso_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return epso_2(as()); - } -} +inline constexpr auto epso_2 = functor; } diff --git a/include/eve/module/math/constant/euler.hpp b/include/eve/module/math/constant/euler.hpp index e632de08f1..b5bb1e7f19 100644 --- a/include/eve/module/math/constant/euler.hpp +++ b/include/eve/module/math/constant/euler.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct euler_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.5bf0aap+1); + if constexpr(Opts::contains(downward2)) return T(0x1.5bf0a8p+1); + else return T(0x1.5bf0a8p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.5bf0a8b14576ap+1); + if constexpr(Opts::contains(downward2)) return T(0x1.5bf0a8b145769p+1); + else return T(0x1.5bf0a8b145769p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(euler_t, euler_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,25 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/euler.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(euler_, euler); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto euler_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant< - T, - 0X402DF854U, - 0X4005BF0A8B145769ULL>(); // 2.7182818284590452353602874713526624977572470937; - } - - template - EVE_FORCEINLINE constexpr auto euler_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) return eve::euler(as()); - else return Ieee_constant(); - } -} +inline constexpr auto euler = functor; } diff --git a/include/eve/module/math/constant/exp_pi.hpp b/include/eve/module/math/constant/exp_pi.hpp index 374599b7da..8026a6550a 100644 --- a/include/eve/module/math/constant/exp_pi.hpp +++ b/include/eve/module/math/constant/exp_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct exp_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.724048p+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.724046p+4); + else return T(0x1.724046p+4); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.724046eb0933ap+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.724046eb09339p+4); + else return T(0x1.724046eb0933ap+4); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(exp_pi_t, exp_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/exp_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(exp_pi_, exp_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto exp_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.724046p+4); - else if constexpr( std::is_same_v ) return T(0x1.724046eb0933ap+4); - } - - template - EVE_FORCEINLINE constexpr auto exp_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.724048p+4); - else if constexpr( std::is_same_v ) return T(0x1.724046eb0933ap+4); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.724046p+4); - else if constexpr( std::is_same_v ) return T(0x1.724046eb09339p+4); - } - } -} +inline constexpr auto exp_pi = functor; } diff --git a/include/eve/module/math/constant/extreme_value_skewness.hpp b/include/eve/module/math/constant/extreme_value_skewness.hpp index 76317b359a..38cb3f8d05 100644 --- a/include/eve/module/math/constant/extreme_value_skewness.hpp +++ b/include/eve/module/math/constant/extreme_value_skewness.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct extreme_value_skewness_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.23b95cp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.23b95ap+0); + else return T(0x1.23b95cp+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.23b95bd431d32p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.23b95bd431d31p+0); + else return T(0x1.23b95bd431d31p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(extreme_value_skewness_t, extreme_value_skewness_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,34 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/extreme_value_skewness.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(extreme_value_skewness_, extreme_value_skewness); - -namespace detail -{ - template - EVE_FORCEINLINE auto extreme_value_skewness_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.23b95cp+0); - else if constexpr( std::is_same_v ) return T(0x1.23b95bd431d31p+0); - } - - template - EVE_FORCEINLINE constexpr auto - extreme_value_skewness_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.23b95cp+0); - else if constexpr( std::is_same_v ) return T(0x1.23b95bd431d32p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.23b95ap+0); - else if constexpr( std::is_same_v ) return T(0x1.23b95bd431d31p+0); - } - } -} +inline constexpr auto extreme_value_skewness = functor; } diff --git a/include/eve/module/math/constant/four_minus_pi.hpp b/include/eve/module/math/constant/four_minus_pi.hpp index 6891ad2201..7f0ad26455 100644 --- a/include/eve/module/math/constant/four_minus_pi.hpp +++ b/include/eve/module/math/constant/four_minus_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct four_minus_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.b7812cp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.b7812ap-1); + else return T(0x1.b7812ap-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.b7812aeef4b9fp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.b7812aeef4b9ep-1); + else return T(0x1.b7812aeef4b9fp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(four_minus_pi_t, four_minus_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/four_minus_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(four_minus_pi_, four_minus_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto four_minus_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.b7812ap-1); - else if constexpr( std::is_same_v ) return T(0x1.b7812aeef4b9fp-1); - } - - template - EVE_FORCEINLINE constexpr auto four_minus_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.b7812cp-1); - else if constexpr( std::is_same_v ) return T(0x1.b7812aeef4b9fp-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.b7812ap-1); - else if constexpr( std::is_same_v ) return T(0x1.b7812aeef4b9ep-1); - } - } -} +inline constexpr auto four_minus_pi = functor; } diff --git a/include/eve/module/math/constant/four_pio_3.hpp b/include/eve/module/math/constant/four_pio_3.hpp index 55e704a4fd..179c15e9c7 100644 --- a/include/eve/module/math/constant/four_pio_3.hpp +++ b/include/eve/module/math/constant/four_pio_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct four_pio_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c1524p+2); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c1522p+2); + else return T(0x1.0c1524p+2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c152382d7366p+2); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c152382d7365p+2); + else return T(0x1.0c152382d7366p+2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(four_pio_3_t, four_pio_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/four_pio_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(four_pio_3_, four_pio_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto four_pio_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.0c1524p+2); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+2); - } - - template - EVE_FORCEINLINE constexpr auto four_pio_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1524p+2); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1522p+2); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7365p+2); - } - } -} +inline constexpr auto four_pio_3 = functor; } diff --git a/include/eve/module/math/constant/glaisher.hpp b/include/eve/module/math/constant/glaisher.hpp index ea56ebe5ab..9f84d578f4 100644 --- a/include/eve/module/math/constant/glaisher.hpp +++ b/include/eve/module/math/constant/glaisher.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct glaisher_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.484d26p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.484d24p+0); + else return T(0x1.484d24p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.484d24f2fd874p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.484d24f2fd873p+0); + else return T(0x1.484d24f2fd873p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(glaisher_t, glaisher_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/glaisher.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(glaisher_, glaisher); - -namespace detail -{ - template - EVE_FORCEINLINE auto glaisher_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.484d24p+0); - else if constexpr( std::is_same_v ) return T(0x1.484d24f2fd873p+0); - } - - template - EVE_FORCEINLINE constexpr auto glaisher_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.484d26p+0); - else if constexpr( std::is_same_v ) return T(0x1.484d24f2fd874p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.484d24p+0); - else if constexpr( std::is_same_v ) return T(0x1.484d24f2fd873p+0); - } - } -} +inline constexpr auto glaisher = functor; } diff --git a/include/eve/module/math/constant/inv_2eps.hpp b/include/eve/module/math/constant/inv_2eps.hpp index 09e5bdc741..df1ffcc70d 100644 --- a/include/eve/module/math/constant/inv_2eps.hpp +++ b/include/eve/module/math/constant/inv_2eps.hpp @@ -7,10 +7,30 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct inv_2eps_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + return T(0x1p+22); + else + return T(0x1p+51); + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(inv_2eps_t, inv_2eps_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,25 +66,5 @@ namespace eve //! @godbolt{doc/math/regular/inv_2eps.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(inv_2eps_, inv_2eps); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto inv_2eps_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - else return T(1); - } - - template - EVE_FORCEINLINE constexpr auto inv_2eps_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return inv_2eps(as()); - } -} +inline constexpr auto inv_2eps = functor; } diff --git a/include/eve/module/math/constant/inv_2pi.hpp b/include/eve/module/math/constant/inv_2pi.hpp index eb8c22656b..810aee185f 100644 --- a/include/eve/module/math/constant/inv_2pi.hpp +++ b/include/eve/module/math/constant/inv_2pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct inv_2pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f308p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306p-3); + else return T(0x1.45f306p-3); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f306dc9c883p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306dc9c882p-3); + else return T(0x1.45f306dc9c883p-3); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(inv_2pi_t, inv_2pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/inv_2pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(inv_2pi_, inv_2pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto inv_2pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.45f306p-3); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-3); - } - - template - EVE_FORCEINLINE constexpr auto inv_2pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f308p-3); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-3); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f306p-3); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c882p-3); - } - } -} +inline constexpr auto inv_2pi = functor; } diff --git a/include/eve/module/math/constant/inv_e.hpp b/include/eve/module/math/constant/inv_e.hpp index 488476f559..2f14ec8e56 100644 --- a/include/eve/module/math/constant/inv_e.hpp +++ b/include/eve/module/math/constant/inv_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct inv_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.78b564p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.78b562p-2); + else return T(0x1.78b564p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.78b56362cef38p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.78b56362cef37p-2); + else return T(0x1.78b56362cef38p-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(inv_e_t, inv_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/inv_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(inv_e_, inv_e); - -namespace detail -{ - template - EVE_FORCEINLINE auto inv_e_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.78b564p-2); - else if constexpr( std::is_same_v ) return T(0x1.78b56362cef38p-2); - } - - template - EVE_FORCEINLINE constexpr auto inv_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.78b564p-2); - else if constexpr( std::is_same_v ) return T(0x1.78b56362cef38p-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.78b562p-2); - else if constexpr( std::is_same_v ) return T(0x1.78b56362cef37p-2); - } - } -} +inline constexpr auto inv_e = functor; } diff --git a/include/eve/module/math/constant/inv_egamma.hpp b/include/eve/module/math/constant/inv_egamma.hpp index cd88310c82..1120f047ed 100644 --- a/include/eve/module/math/constant/inv_egamma.hpp +++ b/include/eve/module/math/constant/inv_egamma.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct inv_egamma_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.bb8228p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.bb8226p+0); + else return T(0x1.bb8226p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.bb8226f502bf8p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.bb8226f502bf7p+0); + else return T(0x1.bb8226f502bf8p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(inv_egamma_t, inv_egamma_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -48,33 +76,5 @@ namespace eve //! @godbolt{doc/math/regular/inv_egamma.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(inv_egamma_, inv_egamma); - -namespace detail -{ - template - EVE_FORCEINLINE auto inv_egamma_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.bb8226p+0); - else if constexpr( std::is_same_v ) return T(0x1.bb8226f502bf8p+0); - } - - template - EVE_FORCEINLINE constexpr auto inv_egamma_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.bb8228p+0); - else if constexpr( std::is_same_v ) return T(0x1.bb8226f502bf8p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.bb8226p+0); - else if constexpr( std::is_same_v ) return T(0x1.bb8226f502bf7p+0); - } - } -} +inline constexpr auto inv_egamma = functor; } diff --git a/include/eve/module/math/constant/inv_pi.hpp b/include/eve/module/math/constant/inv_pi.hpp index 6cc5ac334d..f1ecc5c1e0 100644 --- a/include/eve/module/math/constant/inv_pi.hpp +++ b/include/eve/module/math/constant/inv_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct inv_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f308p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306p-2); + else return T(0x1.45f306p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f306dc9c883p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306dc9c882p-2); + else return T(0x1.45f306dc9c883p-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(inv_pi_t, inv_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/inv_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(inv_pi_, inv_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto inv_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.45f306p-2); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-2); - } - - template - EVE_FORCEINLINE constexpr auto inv_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f308p-2); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f306p-2); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c882p-2); - } - } -} +inline constexpr auto inv_pi = functor; } diff --git a/include/eve/module/math/constant/invcbrt_pi.hpp b/include/eve/module/math/constant/invcbrt_pi.hpp index e07bb51405..db70e921a8 100644 --- a/include/eve/module/math/constant/invcbrt_pi.hpp +++ b/include/eve/module/math/constant/invcbrt_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invcbrt_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.5d95ep-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.5d95dep-1); + else return T(0x1.5d95ep-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.5d95df6bd2aeep-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.5d95df6bd2aedp-1); + else return T(0x1.5d95df6bd2aeep-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invcbrt_pi_t, invcbrt_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invcbrt_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invcbrt_pi_, invcbrt_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto invcbrt_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.5d95ep-1); - else if constexpr( std::is_same_v ) return T(0x1.5d95df6bd2aeep-1); - } - - template - EVE_FORCEINLINE constexpr auto invcbrt_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.5d95ep-1); - else if constexpr( std::is_same_v ) return T(0x1.5d95df6bd2aeep-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.5d95dep-1); - else if constexpr( std::is_same_v ) return T(0x1.5d95df6bd2aedp-1); - } - } -} +inline constexpr auto invcbrt_pi = functor; } diff --git a/include/eve/module/math/constant/invlog10_2.hpp b/include/eve/module/math/constant/invlog10_2.hpp index 05c29ba69c..5e5119533e 100644 --- a/include/eve/module/math/constant/invlog10_2.hpp +++ b/include/eve/module/math/constant/invlog10_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invlog10_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.a934f2p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.a934fp+1 ); + else return T(0x1.a934fp+1 ); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.a934f0979a372p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.a934f0979a371p+1); + else return T(0x1.a934f0979a371p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invlog10_2_t, invlog10_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,25 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invlog10_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invlog10_2_, invlog10_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto invlog10_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto invlog10_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto invlog10_2 = functor; } diff --git a/include/eve/module/math/constant/invlog10_e.hpp b/include/eve/module/math/constant/invlog10_e.hpp index e674218551..9013d918f4 100644 --- a/include/eve/module/math/constant/invlog10_e.hpp +++ b/include/eve/module/math/constant/invlog10_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invlog10_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.26bb1cp+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.26bb1ap+1); + else return T(0x1.26bb1cp+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.26bb1bbb55516p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.26bb1bbb55515p+1); + else return T(0x1.26bb1bbb55516p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invlog10_e_t, invlog10_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invlog10_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invlog10_e_, invlog10_e); - -namespace detail -{ - template - EVE_FORCEINLINE auto invlog10_e_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.26bb1cp+1); - else if constexpr( std::is_same_v ) return T(0x1.26bb1bbb55516p+1); - } - - template - EVE_FORCEINLINE constexpr auto invlog10_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.26bb1cp+1); - else if constexpr( std::is_same_v ) return T(0x1.26bb1bbb55516p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.26bb1ap+1); - else if constexpr( std::is_same_v ) return T(0x1.26bb1bbb55515p+1); - } - } -} +inline constexpr auto invlog10_e = functor; } diff --git a/include/eve/module/math/constant/invlog_10.hpp b/include/eve/module/math/constant/invlog_10.hpp index b2d798fc85..bb63fcb1e6 100644 --- a/include/eve/module/math/constant/invlog_10.hpp +++ b/include/eve/module/math/constant/invlog_10.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invlog_10_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.bcb7b2p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.bcb7bp-2 ); + else return T(0x1.bcb7b2p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.bcb7b1526e50fp-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.bcb7b1526e50ep-2); + else return T(0x1.bcb7b1526e50ep-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invlog_10_t, invlog_10_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,25 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invlog_10.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invlog_10_, invlog_10); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto invlog_10_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto invlog_10_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto invlog_10 = functor; } diff --git a/include/eve/module/math/constant/invlog_2.hpp b/include/eve/module/math/constant/invlog_2.hpp index 558d0177aa..587c7c0c0d 100644 --- a/include/eve/module/math/constant/invlog_2.hpp +++ b/include/eve/module/math/constant/invlog_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invlog_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.715478p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.715476p+0); + else return T(0x1.715476p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.71547652b82ffp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.71547652b82fep+0); + else return T(0x1.71547652b82fep+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invlog_2_t, invlog_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,25 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invlog_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invlog_2_, invlog_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto invlog_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto invlog_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto invlog_2 = functor; } diff --git a/include/eve/module/math/constant/invlog_phi.hpp b/include/eve/module/math/constant/invlog_phi.hpp index 1e616482ed..f060e51f0f 100644 --- a/include/eve/module/math/constant/invlog_phi.hpp +++ b/include/eve/module/math/constant/invlog_phi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invlog_phi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.09fec2p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.09fecp+1); + else return T(0x1.09fecp+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.09fec09279922p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.09fec09279921p+1); + else return T(0x1.09fec09279922p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invlog_phi_t, invlog_phi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,33 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/invlog_phi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invlog_phi_, invlog_phi); - -namespace detail -{ - template - EVE_FORCEINLINE auto invlog_phi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.09fecp+1); - else if constexpr( std::is_same_v ) return T(0x1.09fec09279922p+1); - } - - template - EVE_FORCEINLINE constexpr auto invlog_phi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.09fec2p+1); - else if constexpr( std::is_same_v ) return T(0x1.09fec09279922p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.09fecp+1); - else if constexpr( std::is_same_v ) return T(0x1.09fec09279921p+1); - } - } -} +inline constexpr auto invlog_phi = functor; } diff --git a/include/eve/module/math/constant/invsqrt_2.hpp b/include/eve/module/math/constant/invsqrt_2.hpp index 5a2451d473..0c490cf265 100644 --- a/include/eve/module/math/constant/invsqrt_2.hpp +++ b/include/eve/module/math/constant/invsqrt_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct invsqrt_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.6a09e8p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.6a09e6p-1); + else return T(0x1.6a09e6p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.6a09e667f3bcdp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.6a09e667f3bccp-1); + else return T(0x1.6a09e667f3bcdp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(invsqrt_2_t, invsqrt_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,26 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/invsqrt_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(invsqrt_2_, invsqrt_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto invsqrt_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto invsqrt_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto invsqrt_2 = functor; } diff --git a/include/eve/module/math/constant/khinchin.hpp b/include/eve/module/math/constant/khinchin.hpp index 85d5e765db..e4be666af6 100644 --- a/include/eve/module/math/constant/khinchin.hpp +++ b/include/eve/module/math/constant/khinchin.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct khinchin_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.57bce6p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.57bce4p+1); + else return T(0x1.57bce4p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.57bce423c6d0ep+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.57bce423c6d0dp+1); + else return T(0x1.57bce423c6d0dp+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(khinchin_t, khinchin_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/khinchin.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(khinchin_, khinchin); - -namespace detail -{ - template - EVE_FORCEINLINE auto khinchin_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.57bce4p+1); - else if constexpr( std::is_same_v ) return T(0x1.57bce423c6d0dp+1); - } - - template - EVE_FORCEINLINE constexpr auto khinchin_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.57bce6p+1); - else if constexpr( std::is_same_v ) return T(0x1.57bce423c6d0ep+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.57bce4p+1); - else if constexpr( std::is_same_v ) return T(0x1.57bce423c6d0dp+1); - } - } -} +inline constexpr auto khinchin = functor; } diff --git a/include/eve/module/math/constant/log10_e.hpp b/include/eve/module/math/constant/log10_e.hpp index 491b7afc3f..1471d6f40e 100644 --- a/include/eve/module/math/constant/log10_e.hpp +++ b/include/eve/module/math/constant/log10_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct log10_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.bcb7b2p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.bcb7bp-2 ); + else return T(0x1.bcb7b2p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.bcb7b1526e50fp-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.bcb7b1526e50ep-2); + else return T(0x1.bcb7b1526e50ep-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(log10_e_t, log10_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,26 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/log10_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(log10_e_, log10_e); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto log10_e_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant< - T, - 0X3EDE5BD9, - 0X3FDBCB7B1526E50ELL>(); // 0.43429448190325182765112891891660508229439700580367 - } - - template - EVE_FORCEINLINE constexpr auto log10_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto log10_e = functor; } diff --git a/include/eve/module/math/constant/log2_e.hpp b/include/eve/module/math/constant/log2_e.hpp index a55d194ca4..f23c037835 100644 --- a/include/eve/module/math/constant/log2_e.hpp +++ b/include/eve/module/math/constant/log2_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct log2_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.715478p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.715476p+0); + else return T(0x1.715476p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.71547652b82ffp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.71547652b82fep+0); + else return T(0x1.71547652b82fep+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(log2_e_t, log2_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,26 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/log2_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(log2_e_, log2_e); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto log2_e_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant< - T, - 0X3FB8AA3BU, - 0X3FF71547652B82FEULL>(); // 1.442695040888963407359924681001892137426645954153 - } - - template - EVE_FORCEINLINE constexpr auto log2_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto log2_e = functor; } diff --git a/include/eve/module/math/constant/log_10.hpp b/include/eve/module/math/constant/log_10.hpp index c945da6a95..8d838748b2 100644 --- a/include/eve/module/math/constant/log_10.hpp +++ b/include/eve/module/math/constant/log_10.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct log_10_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.26bb1cp+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.26bb1ap+1); + else return T(0x1.26bb1cp+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.26bb1bbb55516p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.26bb1bbb55515p+1); + else return T(0x1.26bb1bbb55516p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(log_10_t, log_10_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,22 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/log_10.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(log_10_, log_10); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto log_10_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant(); - } - - template - EVE_FORCEINLINE constexpr auto log_10_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) return eve::log_10(as()); - else return Ieee_constant(); - } -} +inline constexpr auto log_10 = functor; } diff --git a/include/eve/module/math/constant/log_2.hpp b/include/eve/module/math/constant/log_2.hpp index e3d386451d..32699e090c 100644 --- a/include/eve/module/math/constant/log_2.hpp +++ b/include/eve/module/math/constant/log_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct log_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.62e43p-1 ); + else if constexpr(Opts::contains(downward2)) return T(0x1.62e42ep-1); + else return T(0x1.62e43p-1 ); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.62e42fefa39fp-1 ); + else if constexpr(Opts::contains(downward2)) return T(0x1.62e42fefa39efp-1); + else return T(0x1.62e42fefa39efp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(log_2_t, log_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,34 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/log_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(log_2_, log_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto log_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto log_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return eve::log_2(as()); - else return Constant(); - } - else - { - if constexpr( std::is_same_v ) return eve::log_2(as()); - else return Constant(); - } - } -} +inline constexpr auto log_2 = functor; } diff --git a/include/eve/module/math/constant/log_phi.hpp b/include/eve/module/math/constant/log_phi.hpp index 74fd722f3e..871d4fef59 100644 --- a/include/eve/module/math/constant/log_phi.hpp +++ b/include/eve/module/math/constant/log_phi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct log_phi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.ecc2ccp-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.ecc2cap-2); + else return T(0x1.ecc2cap-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.ecc2caec5160ap-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.ecc2caec51609p-2); + else return T(0x1.ecc2caec5160ap-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(log_phi_t, log_phi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/log_phi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(log_phi_, log_phi); - -namespace detail -{ - template - EVE_FORCEINLINE auto log_phi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.ecc2cap-2); - else if constexpr( std::is_same_v ) return T(0x1.ecc2caec5160ap-2); - } - - template - EVE_FORCEINLINE constexpr auto log_phi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.ecc2ccp-2); - else if constexpr( std::is_same_v ) return T(0x1.ecc2caec5160ap-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.ecc2cap-2); - else if constexpr( std::is_same_v ) return T(0x1.ecc2caec51609p-2); - } - } -} +inline constexpr auto log_phi = functor; } diff --git a/include/eve/module/math/constant/loglog_2.hpp b/include/eve/module/math/constant/loglog_2.hpp index 74fe84db55..fa92e45878 100644 --- a/include/eve/module/math/constant/loglog_2.hpp +++ b/include/eve/module/math/constant/loglog_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct loglog_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(-0x1.774f28p-2); + else if constexpr(Opts::contains(downward2)) return T(-0x1.774f2ap-2); + else return T(-0x1.774f2ap-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(-0x1.774f29bdd6b9ep-2); + else if constexpr(Opts::contains(downward2)) return T(-0x1.774f29bdd6b9fp-2); + else return T(-0x1.774f29bdd6b9fp-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(loglog_2_t, loglog_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/loglog_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(loglog_2_, loglog_2); - -namespace detail -{ - template - EVE_FORCEINLINE auto loglog_2_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return -0x1.774f2ap-2; - else if constexpr( std::is_same_v ) return -0x1.774f29bdd6b9fp-2; - } - - template - EVE_FORCEINLINE constexpr auto loglog_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return -0x1.774f28p-2; - else if constexpr( std::is_same_v ) return -0x1.774f29bdd6b9ep-2; - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return -0x1.774f2ap-2; - else if constexpr( std::is_same_v ) return -0x1.774f29bdd6b9fp-2; - } - } -} +inline constexpr auto loglog_2 = functor; } diff --git a/include/eve/module/math/constant/maxlog.hpp b/include/eve/module/math/constant/maxlog.hpp index a3a9b30eb4..11efc55734 100644 --- a/include/eve/module/math/constant/maxlog.hpp +++ b/include/eve/module/math/constant/maxlog.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct maxlog_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(0x1.61814ap+6); + } + else + { + return T(0x1.62b7d369a5aa7p+9); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(maxlog_t, maxlog_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,24 +71,5 @@ namespace eve //! @godbolt{doc/math/regular/maxlog.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(maxlog_, maxlog); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto maxlog_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto maxlog_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return maxlog(as()); - } -} +inline constexpr auto maxlog = functor; } diff --git a/include/eve/module/math/constant/maxlog10.hpp b/include/eve/module/math/constant/maxlog10.hpp index 09e807af8a..fc53d1a294 100644 --- a/include/eve/module/math/constant/maxlog10.hpp +++ b/include/eve/module/math/constant/maxlog10.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct maxlog10_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(0x1.31d8b2p+5); + } + else + { + return T(0x1.341aace35661p+8); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(maxlog10_t, maxlog10_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,24 +71,5 @@ namespace eve //! @godbolt{doc/math/regular/maxlog10.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(maxlog10_, maxlog10); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto maxlog10_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto maxlog10_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return maxlog10(as()); - } -} +inline constexpr auto maxlog10 = functor; } diff --git a/include/eve/module/math/constant/maxlog2.hpp b/include/eve/module/math/constant/maxlog2.hpp index 021bc5c4ad..c476283e79 100644 --- a/include/eve/module/math/constant/maxlog2.hpp +++ b/include/eve/module/math/constant/maxlog2.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct maxlog2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(0x1.fcp+6); + } + else + { + return T(0x1.ff8p+9); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(maxlog2_t, maxlog2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,24 +71,5 @@ namespace eve //! @godbolt{doc/math/regular/maxlog2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(maxlog2_, maxlog2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto maxlog2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto maxlog2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return maxlog2(as()); - } -} +inline constexpr auto maxlog2 = functor; } diff --git a/include/eve/module/math/constant/minlog.hpp b/include/eve/module/math/constant/minlog.hpp index 73f793169c..507ef20c60 100644 --- a/include/eve/module/math/constant/minlog.hpp +++ b/include/eve/module/math/constant/minlog.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { + template + struct minlog_t : constant_callable + { + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(-0x1.5d814ap+6); + } + else + { + return T(-0x1.6232bdd7abcd3p+9); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlog_t, minlog_); + }; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,24 +70,5 @@ namespace eve //! @godbolt{doc/math/regular/minlog.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlog_, minlog); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlog_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto minlog_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return minlog(as()); - } -} +inline constexpr auto minlog = functor; } diff --git a/include/eve/module/math/constant/minlog10.hpp b/include/eve/module/math/constant/minlog10.hpp index 3576f390f1..733a4335e0 100644 --- a/include/eve/module/math/constant/minlog10.hpp +++ b/include/eve/module/math/constant/minlog10.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct minlog10_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return Constant(); //T(-0x1.2f703p+5); + } + else + { + return Constant(); //T(-0x1.33a7146f72a42p+8); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlog10_t, minlog10_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,24 +71,5 @@ namespace eve //! @godbolt{doc/math/regular/minlog10.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlog10_, minlog10); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlog10_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto minlog10_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return minlog10(as()); - } -} +inline constexpr auto minlog10 = functor; } diff --git a/include/eve/module/math/constant/minlog10denormal.hpp b/include/eve/module/math/constant/minlog10denormal.hpp index 499db04a45..74dac7f531 100644 --- a/include/eve/module/math/constant/minlog10denormal.hpp +++ b/include/eve/module/math/constant/minlog10denormal.hpp @@ -7,15 +7,39 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct minlog10denormal_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(-0x1.693c6cp+5); + } + else + { + return T(-0x1.439b7422d1bfbp+8); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlog10denormal_t, minlog10denormal_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ //! @var minlog10denormal -//! @brief Callable object computing the least value for which eve::exp10 is not denormal. +//! @brief Callable object computing the least value for which eve::exp10 is not zero. //! //! **Defined in Header** //! @@ -47,25 +71,5 @@ namespace eve //! @godbolt{doc/math/regular/minlog10denormal.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlog10denormal_, minlog10denormal); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlog10denormal_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto - minlog10denormal_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return minlog10denormal(as()); - } -} +inline constexpr auto minlog10denormal = functor; } diff --git a/include/eve/module/math/constant/minlog2.hpp b/include/eve/module/math/constant/minlog2.hpp index 92b309b28d..174dbedfa3 100644 --- a/include/eve/module/math/constant/minlog2.hpp +++ b/include/eve/module/math/constant/minlog2.hpp @@ -7,10 +7,30 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { + template + struct minlog2_t : constant_callable + { + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + return T(-0x1.fcp+6); + else + return T(-0x1.ffp+9); + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlog2_t, minlog2_); + }; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,24 +66,5 @@ namespace eve //! @godbolt{doc/math/regular/minlog2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlog2_, minlog2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlog2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto minlog2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return minlog2(as()); - } -} +inline constexpr auto minlog2= functor; } diff --git a/include/eve/module/math/constant/minlog2denormal.hpp b/include/eve/module/math/constant/minlog2denormal.hpp index 1949228072..2bacfbebb0 100644 --- a/include/eve/module/math/constant/minlog2denormal.hpp +++ b/include/eve/module/math/constant/minlog2denormal.hpp @@ -7,10 +7,30 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct minlog2denormal_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + return T(-0x1.2cp+7); + else + return T(-0x1.0cbffffffffffp+10); + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlog2denormal_t, minlog2denormal_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -40,32 +60,12 @@ namespace eve //! **Return value** //! //! The call `eve::minlog2denormal(as())` returns the least value for which eve::exp2 -//! is not denormal. +//! is not zero. //! //! @groupheader{Example} //! //! @godbolt{doc/math/regular/minlog2denormal.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlog2denormal_, minlog2denormal); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlog2denormal_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return T(-150); - else if constexpr( std::is_same_v ) return T(-1075); - } - - template - EVE_FORCEINLINE constexpr auto - minlog2denormal_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - return minlog2denormal(as()); - } -} +inline constexpr auto minlog2denormal = functor; } diff --git a/include/eve/module/math/constant/minlogdenormal.hpp b/include/eve/module/math/constant/minlogdenormal.hpp index 7217fcd2d9..ec664a9bb1 100644 --- a/include/eve/module/math/constant/minlogdenormal.hpp +++ b/include/eve/module/math/constant/minlogdenormal.hpp @@ -7,10 +7,34 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct minlogdenormal_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + return T(-0x1.9fe36ap+6); + } + else + { + return T(-0x1.74910d52d3052p+9); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(minlogdenormal_t, minlogdenormal_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -40,25 +64,12 @@ namespace eve //! **Return value** //! //! The call `eve::minlogdenormal(as())` returns the least value for which -//! eve::exp is not denormal. +//! eve::exp is not zero. //! //! @groupheader{Example} //! //! @godbolt{doc/math/regular/minlogdenormal.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(minlogdenormal_, minlogdenormal); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto minlogdenormal_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); // -103.972084 - else if constexpr( std::is_same_v ) - return Constant(); //-745.1332191019413358 - } -} +inline constexpr auto minlogdenormal = functor; } diff --git a/include/eve/module/math/constant/phi.hpp b/include/eve/module/math/constant/phi.hpp index 1e38c8bdd3..160a380fae 100644 --- a/include/eve/module/math/constant/phi.hpp +++ b/include/eve/module/math/constant/phi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct phi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.9e377cp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.9e377ap+0); + else return T(0x1.9e377ap+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.9e3779b97f4a8p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.9e3779b97f4a7p+0); + else return T(0x1.9e3779b97f4a8p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(phi_t, phi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,23 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/phi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(phi_, phi); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto phi_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant(); - } - - template - EVE_FORCEINLINE constexpr auto phi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto phi = functor; } diff --git a/include/eve/module/math/constant/pi.hpp b/include/eve/module/math/constant/pi.hpp index 745422ff42..e1d56bcbb8 100644 --- a/include/eve/module/math/constant/pi.hpp +++ b/include/eve/module/math/constant/pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb6p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb4p+1); + else return T(0x1.921fb6p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb54442d19p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb54442d18p+1); + else return T(0x1.921fb54442d18p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi_t, pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,34 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi_, pi); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto pi_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return eve::pi(as()); - else return Constant(); - } - else - { - if constexpr( std::is_same_v ) return eve::pi(as()); - else return Constant(); - } - } -} +inline constexpr auto pi = functor; } diff --git a/include/eve/module/math/constant/pi2.hpp b/include/eve/module/math/constant/pi2.hpp index a6eee3e680..7571b156ed 100644 --- a/include/eve/module/math/constant/pi2.hpp +++ b/include/eve/module/math/constant/pi2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.3bd3cep+3); + else if constexpr(Opts::contains(downward2)) return T(0x1.3bd3ccp+3); + else return T(0x1.3bd3ccp+3); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.3bd3cc9be45dfp+3); + else if constexpr(Opts::contains(downward2)) return T(0x1.3bd3cc9be45dep+3); + else return T(0x1.3bd3cc9be45dep+3); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi2_t, pi2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi2_, pi2); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi2_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.3bd3ccp+3); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dep+3); - } - - template - EVE_FORCEINLINE constexpr auto pi2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.3bd3cep+3); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dfp+3); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.3bd3ccp+3); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dep+3); - } - } -} +inline constexpr auto pi2 = functor; } diff --git a/include/eve/module/math/constant/pi2o_16.hpp b/include/eve/module/math/constant/pi2o_16.hpp index 393b72fc77..4bb7343478 100644 --- a/include/eve/module/math/constant/pi2o_16.hpp +++ b/include/eve/module/math/constant/pi2o_16.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi2o_16_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.3bd3cep-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.3bd3ccp-1); + else return T(0x1.3bd3ccp-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.3bd3cc9be45dfp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.3bd3cc9be45dep-1); + else return T(0x1.3bd3cc9be45dep-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi2o_16_t, pi2o_16_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi2o_16.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi2o_16_, pi2o_16); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi2o_16_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.3bd3ccp-1); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dep-1); - } - - template - EVE_FORCEINLINE constexpr auto pi2o_16_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.3bd3cep-1); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dfp-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.3bd3ccp-1); - else if constexpr( std::is_same_v ) return T(0x1.3bd3cc9be45dep-1); - } - } -} +inline constexpr auto pi2o_16 = functor; } diff --git a/include/eve/module/math/constant/pi2o_6.hpp b/include/eve/module/math/constant/pi2o_6.hpp index c758a49203..bfc9924ccc 100644 --- a/include/eve/module/math/constant/pi2o_6.hpp +++ b/include/eve/module/math/constant/pi2o_6.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi2o_6_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.a51a68p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a51a66p+0); + else return T(0x1.a51a66p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.a51a6625307d4p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a51a6625307d3p+0); + else return T(0x1.a51a6625307d3p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi2o_6_t, pi2o_6_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi2o_6.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi2o_6_, pi2o_6); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi2o_6_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.a51a66p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d3p+0); - } - - template - EVE_FORCEINLINE constexpr auto pi2o_6_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a51a68p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d4p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a51a66p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d3p+0); - } - } -} +inline constexpr auto pi2o_6 = functor; } diff --git a/include/eve/module/math/constant/pi3.hpp b/include/eve/module/math/constant/pi3.hpp index 3476bcb269..9a0e967556 100644 --- a/include/eve/module/math/constant/pi3.hpp +++ b/include/eve/module/math/constant/pi3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.f019b6p+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.f019b4p+4); + else return T(0x1.f019b6p+4); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.f019b59389d7dp+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.f019b59389d7cp+4); + else return T(0x1.f019b59389d7cp+4); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi3_t, pi3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi3_, pi3); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.f019b6p+4); - else if constexpr( std::is_same_v ) return T(0x1.f019b59389d7cp+4); - } - - template - EVE_FORCEINLINE constexpr auto pi3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.f019b6p+4); - else if constexpr( std::is_same_v ) return T(0x1.f019b59389d7dp+4); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.f019b4p+4); - else if constexpr( std::is_same_v ) return T(0x1.f019b59389d7cp+4); - } - } -} +inline constexpr auto pi3 = functor; } diff --git a/include/eve/module/math/constant/pi_minus_3.hpp b/include/eve/module/math/constant/pi_minus_3.hpp index 7ff84f78c9..9a47914d2e 100644 --- a/include/eve/module/math/constant/pi_minus_3.hpp +++ b/include/eve/module/math/constant/pi_minus_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi_minus_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.21fb56p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.21fb54p-3); + else return T(0x1.21fb54p-3); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.21fb54442d185p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.21fb54442d184p-3); + else return T(0x1.21fb54442d184p-3); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi_minus_3_t, pi_minus_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi_minus_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi_minus_3_, pi_minus_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi_minus_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.21fb54p-3); - else if constexpr( std::is_same_v ) return T(0x1.21fb54442d184p-3); - } - - template - EVE_FORCEINLINE constexpr auto pi_minus_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.21fb56p-3); - else if constexpr( std::is_same_v ) return T(0x1.21fb54442d185p-3); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.21fb54p-3); - else if constexpr( std::is_same_v ) return T(0x1.21fb54442d184p-3); - } - } -} +inline constexpr auto pi_minus_3 = functor; } diff --git a/include/eve/module/math/constant/pi_pow_e.hpp b/include/eve/module/math/constant/pi_pow_e.hpp index 7770eb6cf2..890fa9599c 100644 --- a/include/eve/module/math/constant/pi_pow_e.hpp +++ b/include/eve/module/math/constant/pi_pow_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pi_pow_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.6758b6p+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.6758b4p+4); + else return T(0x1.6758b6p+4); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.6758b5c381112p+4); + else if constexpr(Opts::contains(downward2)) return T(0x1.6758b5c381111p+4); + else return T(0x1.6758b5c381111p+4); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pi_pow_e_t, pi_pow_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pi_pow_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pi_pow_e_, pi_pow_e); - -namespace detail -{ - template - EVE_FORCEINLINE auto pi_pow_e_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.6758b6p+4); - else if constexpr( std::is_same_v ) return T(0x1.6758b5c381111p+4); - } - - template - EVE_FORCEINLINE constexpr auto pi_pow_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.6758b6p+4); - else if constexpr( std::is_same_v ) return T(0x1.6758b5c381112p+4); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.6758b4p+4); - else if constexpr( std::is_same_v ) return T(0x1.6758b5c381111p+4); - } - } -} +inline constexpr auto pi_pow_e = functor; } diff --git a/include/eve/module/math/constant/pio_2.hpp b/include/eve/module/math/constant/pio_2.hpp index 1a3fbc62c3..4f4fd2f75d 100644 --- a/include/eve/module/math/constant/pio_2.hpp +++ b/include/eve/module/math/constant/pio_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pio_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb6p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb4p+0); + else return T(0x1.921fb6p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb54442d19p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb54442d18p+0); + else return T(0x1.921fb54442d18p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pio_2_t, pio_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,34 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pio_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pio_2_, pio_2); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto pio_2_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto pio_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return eve::pio_2(as()); - else return Constant(); - } - else - { - if constexpr( std::is_same_v ) return eve::pio_2(as()); - else return Constant(); - } - } -} +inline constexpr auto pio_2 = functor; } diff --git a/include/eve/module/math/constant/pio_3.hpp b/include/eve/module/math/constant/pio_3.hpp index 908b20853c..039f7f478f 100644 --- a/include/eve/module/math/constant/pio_3.hpp +++ b/include/eve/module/math/constant/pio_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pio_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c1524p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c1522p+0); + else return T(0x1.0c1524p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c152382d7366p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c152382d7365p+0); + else return T(0x1.0c152382d7366p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pio_3_t, pio_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pio_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pio_3_, pio_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto pio_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.0c1524p+0); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+0); - } - - template - EVE_FORCEINLINE constexpr auto pio_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1524p+0); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1522p+0); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7365p+0); - } - } -} +inline constexpr auto pio_3 = functor; } diff --git a/include/eve/module/math/constant/pio_4.hpp b/include/eve/module/math/constant/pio_4.hpp index 782b80aa90..4189b77c9a 100644 --- a/include/eve/module/math/constant/pio_4.hpp +++ b/include/eve/module/math/constant/pio_4.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pio_4_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb6p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb4p-1); + else return T(0x1.921fb6p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb54442d19p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb54442d18p-1); + else return T(0x1.921fb54442d18p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pio_4_t, pio_4_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,34 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pio_4.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pio_4_, pio_4); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto pio_4_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - using t_t = element_type_t; - - if constexpr( std::is_same_v ) return Constant(); - else if constexpr( std::is_same_v ) return Constant(); - } - - template - EVE_FORCEINLINE constexpr auto pio_4_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return eve::pio_4(as()); - else return Constant(); - } - else - { - if constexpr( std::is_same_v ) return eve::pio_4(as()); - else return Constant(); - } - } -} +inline constexpr auto pio_4 = functor; } diff --git a/include/eve/module/math/constant/pio_6.hpp b/include/eve/module/math/constant/pio_6.hpp index 621f03b96f..f6986d12b7 100644 --- a/include/eve/module/math/constant/pio_6.hpp +++ b/include/eve/module/math/constant/pio_6.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct pio_6_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c1524p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c1522p-1); + else return T(0x1.0c1524p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c152382d7366p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c152382d7365p-1); + else return T(0x1.0c152382d7366p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(pio_6_t, pio_6_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/pio_6.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(pio_6_, pio_6); - -namespace detail -{ - template - EVE_FORCEINLINE auto pio_6_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.0c1524p-1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p-1); - } - - template - EVE_FORCEINLINE constexpr auto pio_6_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1524p-1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1522p-1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7365p-1); - } - } -} +inline constexpr auto pio_6 = functor; } diff --git a/include/eve/module/math/constant/quarter.hpp b/include/eve/module/math/constant/quarter.hpp index 8038c661bc..2c2fb88963 100644 --- a/include/eve/module/math/constant/quarter.hpp +++ b/include/eve/module/math/constant/quarter.hpp @@ -7,10 +7,27 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct quarter_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + return T(0x1p-2); + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(quarter_t, quarter_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,23 +63,5 @@ namespace eve //! @godbolt{doc/math/regular/quarter.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(quarter_, quarter); - -namespace detail -{ - template - EVE_FORCEINLINE auto quarter_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.0p-2); - else if constexpr( std::is_same_v ) return T(0x1.0p-2); - } - - template - EVE_FORCEINLINE constexpr auto quarter_(EVE_SUPPORTS(cpu_), D const&, as const& a) noexcept - requires(is_one_of(types {})) - { - return quarter(a); - } -} +inline constexpr auto quarter = functor; } diff --git a/include/eve/module/math/constant/rayleigh_kurtosis.hpp b/include/eve/module/math/constant/rayleigh_kurtosis.hpp index c169eacad3..e1267aa150 100644 --- a/include/eve/module/math/constant/rayleigh_kurtosis.hpp +++ b/include/eve/module/math/constant/rayleigh_kurtosis.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rayleigh_kurtosis_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.9f5f18p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.9f5f16p+1); + else return T(0x1.9f5f16p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.9f5f161186c6p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.9f5f161186c5fp+1); + else return T(0x1.9f5f161186c5fp+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rayleigh_kurtosis_t, rayleigh_kurtosis_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,34 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/rayleigh_kurtosis.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rayleigh_kurtosis_, rayleigh_kurtosis); - -namespace detail -{ - template - EVE_FORCEINLINE auto rayleigh_kurtosis_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.9f5f16p+1); - else if constexpr( std::is_same_v ) return T(0x1.9f5f161186c5fp+1); - } - - template - EVE_FORCEINLINE constexpr auto - rayleigh_kurtosis_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.9f5f18p+1); - else if constexpr( std::is_same_v ) return T(0x1.9f5f161186c6p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.9f5f16p+1); - else if constexpr( std::is_same_v ) return T(0x1.9f5f161186c5fp+1); - } - } -} +inline constexpr auto rayleigh_kurtosis = functor; } diff --git a/include/eve/module/math/constant/rayleigh_kurtosis_excess.hpp b/include/eve/module/math/constant/rayleigh_kurtosis_excess.hpp index 4a9574bc88..1ef3a41dea 100644 --- a/include/eve/module/math/constant/rayleigh_kurtosis_excess.hpp +++ b/include/eve/module/math/constant/rayleigh_kurtosis_excess.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rayleigh_kurtosis_excess_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.f5f162p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.f5f16p-3); + else return T(0x1.f5f162p-3); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.f5f161186c5f2p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.f5f161186c5f1p-3); + else return T(0x1.f5f161186c5f2p-3); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rayleigh_kurtosis_excess_t, rayleigh_kurtosis_excess_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,34 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/rayleigh_kurtosis_excess.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rayleigh_kurtosis_excess_, rayleigh_kurtosis_excess); - -namespace detail -{ - template - EVE_FORCEINLINE auto rayleigh_kurtosis_excess_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.f5f162p-3); - else if constexpr( std::is_same_v ) return T(0x1.f5f161186c5f2p-3); - } - - template - EVE_FORCEINLINE constexpr auto - rayleigh_kurtosis_excess_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.f5f162p-3); - else if constexpr( std::is_same_v ) return T(0x1.f5f161186c5f2p-3); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.f5f16p-3); - else if constexpr( std::is_same_v ) return T(0x1.f5f161186c5f1p-3); - } - } -} +inline constexpr auto rayleigh_kurtosis_excess = functor; } diff --git a/include/eve/module/math/constant/rayleigh_skewness.hpp b/include/eve/module/math/constant/rayleigh_skewness.hpp index 0d41a13bb3..3f97151260 100644 --- a/include/eve/module/math/constant/rayleigh_skewness.hpp +++ b/include/eve/module/math/constant/rayleigh_skewness.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rayleigh_skewness_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.4320fp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.4320eep-1); + else return T(0x1.4320fp-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.4320efa6fa904p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.4320efa6fa903p-1); + else return T(0x1.4320efa6fa904p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rayleigh_skewness_t, rayleigh_skewness_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,34 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/rayleigh_skewness.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rayleigh_skewness_, rayleigh_skewness); - -namespace detail -{ - template - EVE_FORCEINLINE auto rayleigh_skewness_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.4320fp-1); - else if constexpr( std::is_same_v ) return T(0x1.4320efa6fa904p-1); - } - - template - EVE_FORCEINLINE constexpr auto - rayleigh_skewness_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.4320fp-1); - else if constexpr( std::is_same_v ) return T(0x1.4320efa6fa904p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.4320eep-1); - else if constexpr( std::is_same_v ) return T(0x1.4320efa6fa903p-1); - } - } -} +inline constexpr auto rayleigh_skewness = functor; } diff --git a/include/eve/module/math/constant/rsqrt_2pi.hpp b/include/eve/module/math/constant/rsqrt_2pi.hpp index c1d3ab3d17..0c3a477bc9 100644 --- a/include/eve/module/math/constant/rsqrt_2pi.hpp +++ b/include/eve/module/math/constant/rsqrt_2pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rsqrt_2pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.988454p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.988452p-2); + else return T(0x1.988454p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.9884533d43651p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.9884533d4365p-2); + else return T(0x1.9884533d43651p-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rsqrt_2pi_t, rsqrt_2pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/rsqrt_2pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rsqrt_2pi_, rsqrt_2pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto rsqrt_2pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.988454p-2); - else if constexpr( std::is_same_v ) return T(0x1.9884533d43651p-2); - } - - template - EVE_FORCEINLINE constexpr auto rsqrt_2pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.988454p-2); - else if constexpr( std::is_same_v ) return T(0x1.9884533d43651p-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.988452p-2); - else if constexpr( std::is_same_v ) return T(0x1.9884533d4365p-2); - } - } -} +inline constexpr auto rsqrt_2pi = functor; } diff --git a/include/eve/module/math/constant/rsqrt_e.hpp b/include/eve/module/math/constant/rsqrt_e.hpp index 45f7c07b3e..f3dc3997be 100644 --- a/include/eve/module/math/constant/rsqrt_e.hpp +++ b/include/eve/module/math/constant/rsqrt_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rsqrt_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.368b3p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.368b2ep-1); + else return T(0x1.368b3p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.368b2fc6f960ap-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.368b2fc6f9609p-1); + else return T(0x1.368b2fc6f960ap-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rsqrt_e_t, rsqrt_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,33 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/rsqrt_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rsqrt_e_, rsqrt_e); - -namespace detail -{ - template - EVE_FORCEINLINE auto rsqrt_e_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.368b3p-1); - else if constexpr( std::is_same_v ) return T(0x1.368b2fc6f960ap-1); - } - - template - EVE_FORCEINLINE constexpr auto rsqrt_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.368b3p-1); - else if constexpr( std::is_same_v ) return T(0x1.368b2fc6f960ap-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.368b2ep-1); - else if constexpr( std::is_same_v ) return T(0x1.368b2fc6f9609p-1); - } - } -} +inline constexpr auto rsqrt_e = functor; } diff --git a/include/eve/module/math/constant/rsqrt_pi.hpp b/include/eve/module/math/constant/rsqrt_pi.hpp index e522785b97..61bd117f01 100644 --- a/include/eve/module/math/constant/rsqrt_pi.hpp +++ b/include/eve/module/math/constant/rsqrt_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rsqrt_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.20dd76p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.20dd74p-1); + else return T(0x1.20dd76p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.20dd750429b6ep-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.20dd750429b6dp-1); + else return T(0x1.20dd750429b6dp-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rsqrt_pi_t, rsqrt_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,28 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/rsqrt_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rsqrt_pi_, rsqrt_pi); - -namespace detail -{ - template - EVE_FORCEINLINE constexpr auto rsqrt_pi_(EVE_SUPPORTS(cpu_), as const&) noexcept - { - return Ieee_constant< - T, - 0X3F106EBBU, - 0X3FE20DD750429B6DULL>(); // 0.564189583547756286948079451560772585844050629329 - } - - template - EVE_FORCEINLINE constexpr auto rsqrt_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - { - return Ieee_constant(); - } - else { return Ieee_constant(); } - } -} +inline constexpr auto rsqrt_pi = functor; } diff --git a/include/eve/module/math/constant/rsqrt_pio_2.hpp b/include/eve/module/math/constant/rsqrt_pio_2.hpp index d3f2b145aa..97cb6f4169 100644 --- a/include/eve/module/math/constant/rsqrt_pio_2.hpp +++ b/include/eve/module/math/constant/rsqrt_pio_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct rsqrt_pio_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.988454p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.988452p-1); + else return T(0x1.988454p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.9884533d436511p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.9884533d4365p-1); + else return T(0x1.9884533d43651p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(rsqrt_pio_2_t, rsqrt_pio_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/rsqrt_pio_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(rsqrt_pio_2_, rsqrt_pio_2); - -namespace detail -{ - template - EVE_FORCEINLINE auto rsqrt_pio_2_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.988454p-1); - else if constexpr( std::is_same_v ) return T(0x1.9884533d43651p-1); - } - - template - EVE_FORCEINLINE constexpr auto rsqrt_pio_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.988454p-1); - else if constexpr( std::is_same_v ) return T(0x1.9884533d43651p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.988452p-1); - else if constexpr( std::is_same_v ) return T(0x1.9884533d4365p-1); - } - } -} +inline constexpr auto rsqrt_pio_2 = functor; } diff --git a/include/eve/module/math/constant/sin_1.hpp b/include/eve/module/math/constant/sin_1.hpp index 4316603363..b29e8c5cce 100644 --- a/include/eve/module/math/constant/sin_1.hpp +++ b/include/eve/module/math/constant/sin_1.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sin_1_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.aed54ap-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.aed548p-1); + else return T(0x1.aed548p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.aed548f090cefp-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.aed548f090ceep-1); + else return T(0x1.aed548f090ceep-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sin_1_t, sin_1_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sin_1.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sin_1_, sin_1); - -namespace detail -{ - template - EVE_FORCEINLINE auto sin_1_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.aed548p-1); - else if constexpr( std::is_same_v ) return T(0x1.aed548f090ceep-1); - } - - template - EVE_FORCEINLINE constexpr auto sin_1_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.aed54ap-1); - else if constexpr( std::is_same_v ) return T(0x1.aed548f090cefp-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.aed548p-1); - else if constexpr( std::is_same_v ) return T(0x1.aed548f090ceep-1); - } - } -} +inline constexpr auto sin_1 = functor; } diff --git a/include/eve/module/math/constant/sinh_1.hpp b/include/eve/module/math/constant/sinh_1.hpp index a771a0a263..b73f213dbd 100644 --- a/include/eve/module/math/constant/sinh_1.hpp +++ b/include/eve/module/math/constant/sinh_1.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sinh_1_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.2cd9fep+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.2cd9fcp+0); + else return T(0x1.2cd9fcp+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.2cd9fc44eb983p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.2cd9fc44eb982p+0); + else return T(0x1.2cd9fc44eb982p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sinh_1_t, sinh_1_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sinh_1.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sinh_1_, sinh_1); - -namespace detail -{ - template - EVE_FORCEINLINE auto sinh_1_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.2cd9fcp+0); - else if constexpr( std::is_same_v ) return T(0x1.2cd9fc44eb982p+0); - } - - template - EVE_FORCEINLINE constexpr auto sinh_1_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2cd9fep+0); - else if constexpr( std::is_same_v ) return T(0x1.2cd9fc44eb983p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2cd9fcp+0); - else if constexpr( std::is_same_v ) return T(0x1.2cd9fc44eb982p+0); - } - } -} +inline constexpr auto sinh_1 = functor; } diff --git a/include/eve/module/math/constant/sixth.hpp b/include/eve/module/math/constant/sixth.hpp index fae2c4da8f..bbcb67bcd4 100644 --- a/include/eve/module/math/constant/sixth.hpp +++ b/include/eve/module/math/constant/sixth.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sixth_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.555556p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.555554p-3); + else return T(0x1.555556p-3); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.5555555555556p-3); + else if constexpr(Opts::contains(downward2)) return T(0x1.5555555555555p-3); + else return T(0x1.5555555555555p-3); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sixth_t, sixth_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sixth.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sixth_, sixth); - -namespace detail -{ - template - EVE_FORCEINLINE auto sixth_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.555556p-3); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-3); - } - - template - EVE_FORCEINLINE constexpr auto sixth_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555556p-3); - else if constexpr( std::is_same_v ) return T(0x1.5555555555556p-3); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555554p-3); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-3); - } - } -} +inline constexpr auto sixth = functor; } diff --git a/include/eve/module/math/constant/sqrt_2.hpp b/include/eve/module/math/constant/sqrt_2.hpp index f6e7b81f9d..3f5fad4713 100644 --- a/include/eve/module/math/constant/sqrt_2.hpp +++ b/include/eve/module/math/constant/sqrt_2.hpp @@ -7,10 +7,39 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.6a09e8p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.6a09e6p+0); + else return T(0x1.6a09e6p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.6a09e667f3bcdp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.6a09e667f3bccp+0); + else return T(0x1.6a09e667f3bcdp+0); + } + } + + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_2_t, sqrt_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,26 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_2_, sqrt_2); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_2_(EVE_SUPPORTS(cpu_), eve::as const& = {}) noexcept - { - return Ieee_constant< - T, - 0X3FB504F3U, - 0X3FF6A09E667F3BCDULL>(); // 1.41421356237309504880168872420969807856967187537694 - } - - template - EVE_FORCEINLINE constexpr auto sqrt_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto sqrt_2 = functor; } diff --git a/include/eve/module/math/constant/sqrt_2pi.hpp b/include/eve/module/math/constant/sqrt_2pi.hpp index 2ade42ee13..f1de052ce8 100644 --- a/include/eve/module/math/constant/sqrt_2pi.hpp +++ b/include/eve/module/math/constant/sqrt_2pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_2pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.40d932p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.40d93p+1); + else return T(0x1.40d932p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.40d931ff62706p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.40d931ff62705p+1); + else return T(0x1.40d931ff62706p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_2pi_t, sqrt_2pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_2pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_2pi_, sqrt_2pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_2pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.40d932p+1); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62706p+1); - } - - template - EVE_FORCEINLINE constexpr auto sqrt_2pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.40d932p+1); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62706p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.40d93p+1); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62705p+1); - } - } -} +inline constexpr auto sqrt_2pi = functor; } diff --git a/include/eve/module/math/constant/sqrt_3.hpp b/include/eve/module/math/constant/sqrt_3.hpp index fb44dac8a1..fe67956d85 100644 --- a/include/eve/module/math/constant/sqrt_3.hpp +++ b/include/eve/module/math/constant/sqrt_3.hpp @@ -7,10 +7,39 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.bb67b0p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.bb67aep+0); + else return T(0x1.bb67aep+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.bb67ae8584cabp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.bb67ae8584caap+0); + else return T(0x1.bb67ae8584caap+0); + } + } + + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_3_t, sqrt_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,23 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_3_, sqrt_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_3_(EVE_SUPPORTS(cpu_), eve::as const& = {}) noexcept - { - return Ieee_constant(); - } - - template - EVE_FORCEINLINE constexpr auto sqrt_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - if constexpr( std::is_same_v ) - return Ieee_constant(); - else return Ieee_constant(); - } -} +inline constexpr auto sqrt_3 = functor; } diff --git a/include/eve/module/math/constant/sqrt_e.hpp b/include/eve/module/math/constant/sqrt_e.hpp index 9d70fce52a..39a3c8b066 100644 --- a/include/eve/module/math/constant/sqrt_e.hpp +++ b/include/eve/module/math/constant/sqrt_e.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_e_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.a6129ap+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a61298p+0); + else return T(0x1.a61298p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.a61298e1e069cp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a61298e1e069bp+0); + else return T(0x1.a61298e1e069cp+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_e_t, sqrt_e_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -47,33 +75,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_e.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_e_, sqrt_e); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_e_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.a61298p+0); - else if constexpr( std::is_same_v ) return T(0x1.a61298e1e069cp+0); - } - - template - EVE_FORCEINLINE constexpr auto sqrt_e_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a6129ap+0); - else if constexpr( std::is_same_v ) return T(0x1.a61298e1e069cp+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a61298p+0); - else if constexpr( std::is_same_v ) return T(0x1.a61298e1e069bp+0); - } - } -} +inline constexpr auto sqrt_e = functor; } diff --git a/include/eve/module/math/constant/sqrt_pi.hpp b/include/eve/module/math/constant/sqrt_pi.hpp index a39ea03c5a..ba7d62e173 100644 --- a/include/eve/module/math/constant/sqrt_pi.hpp +++ b/include/eve/module/math/constant/sqrt_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.c5bf8ap+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.c5bf88p+0); + else return T(0x1.c5bf8ap+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.c5bf891b4ef6bp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.c5bf891b4ef6ap+0); + else return T(0x1.c5bf891b4ef6bp+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_pi_t, sqrt_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_pi_, sqrt_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.c5bf8ap+0); - else if constexpr( std::is_same_v ) return T(0x1.c5bf891b4ef6bp+0); - } - - template - EVE_FORCEINLINE constexpr auto sqrt_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.c5bf8ap+0); - else if constexpr( std::is_same_v ) return T(0x1.c5bf891b4ef6bp+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.c5bf88p+0); - else if constexpr( std::is_same_v ) return T(0x1.c5bf891b4ef6ap+0); - } - } -} +inline constexpr auto sqrt_pi = functor; } diff --git a/include/eve/module/math/constant/sqrt_pio_2.hpp b/include/eve/module/math/constant/sqrt_pio_2.hpp index 76f14aad5b..ebd1fac616 100644 --- a/include/eve/module/math/constant/sqrt_pio_2.hpp +++ b/include/eve/module/math/constant/sqrt_pio_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrt_pio_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.40d932p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.40d93p+0); + else return T(0x1.40d932p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.40d931ff62706p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.40d931ff62705p+0); + else return T(0x1.40d931ff62706p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrt_pio_2_t, sqrt_pio_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrt_pio_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrt_pio_2_, sqrt_pio_2); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrt_pio_2_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.40d932p+0); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62706p+0); - } - - template - EVE_FORCEINLINE constexpr auto sqrt_pio_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.40d932p+0); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62706p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.40d93p+0); - else if constexpr( std::is_same_v ) return T(0x1.40d931ff62705p+0); - } - } -} +inline constexpr auto sqrt_pio_2 = functor; } diff --git a/include/eve/module/math/constant/sqrtlog_4.hpp b/include/eve/module/math/constant/sqrtlog_4.hpp index ae6031b13a..e78fb7da44 100644 --- a/include/eve/module/math/constant/sqrtlog_4.hpp +++ b/include/eve/module/math/constant/sqrtlog_4.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct sqrtlog_4_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.2d6acp+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.2d6abep+0); + else return T(0x1.2d6abep+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.2d6abe44afc44p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.2d6abe44afc43p+0); + else return T(0x1.2d6abe44afc43p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(sqrtlog_4_t, sqrtlog_4_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/sqrtlog_4.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(sqrtlog_4_, sqrtlog_4); - -namespace detail -{ - template - EVE_FORCEINLINE auto sqrtlog_4_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.2d6abep+0); - else if constexpr( std::is_same_v ) return T(0x1.2d6abe44afc43p+0); - } - - template - EVE_FORCEINLINE constexpr auto sqrtlog_4_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2d6acp+0); - else if constexpr( std::is_same_v ) return T(0x1.2d6abe44afc44p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2d6abep+0); - else if constexpr( std::is_same_v ) return T(0x1.2d6abe44afc43p+0); - } - } -} +inline constexpr auto sqrtlog_4 = functor; } diff --git a/include/eve/module/math/constant/third.hpp b/include/eve/module/math/constant/third.hpp index e43ac6eb0d..fde257b631 100644 --- a/include/eve/module/math/constant/third.hpp +++ b/include/eve/module/math/constant/third.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct third_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.555556p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.555554p-2); + else return T(0x1.555556p-2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.5555555555556p-2); + else if constexpr(Opts::contains(downward2)) return T(0x1.5555555555555p-2); + else return T(0x1.5555555555555p-2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(third_t, third_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/third.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(third_, third); - -namespace detail -{ - template - EVE_FORCEINLINE auto third_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.555556p-2); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-2); - } - - template - EVE_FORCEINLINE constexpr auto third_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555556p-2); - else if constexpr( std::is_same_v ) return T(0x1.5555555555556p-2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555554p-2); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-2); - } - } -} +inline constexpr auto third = functor; } diff --git a/include/eve/module/math/constant/three_o_4.hpp b/include/eve/module/math/constant/three_o_4.hpp index 6263b64d2e..6d83a9528f 100644 --- a/include/eve/module/math/constant/three_o_4.hpp +++ b/include/eve/module/math/constant/three_o_4.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct three_o_4_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.8p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.8p-1); + else return T(0x1.8p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.8p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.8p-1); + else return T(0x1.8p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(three_o_4_t, three_o_4_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/three_o_4.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(three_o_4_, three_o_4); - -namespace detail -{ - template - EVE_FORCEINLINE auto three_o_4_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.8p-1); - else if constexpr( std::is_same_v ) return T(0x1.8p-1); - } - - template - EVE_FORCEINLINE constexpr auto three_o_4_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.8p-1); - else if constexpr( std::is_same_v ) return T(0x1.8p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.8p-1); - else if constexpr( std::is_same_v ) return T(0x1.8p-1); - } - } -} +inline constexpr auto three_o_4 = functor; } diff --git a/include/eve/module/math/constant/three_pio_4.hpp b/include/eve/module/math/constant/three_pio_4.hpp index 32f62a6237..4198594c9c 100644 --- a/include/eve/module/math/constant/three_pio_4.hpp +++ b/include/eve/module/math/constant/three_pio_4.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct three_pio_4_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.2d97c8p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.2d97c6p+1); + else return T(0x1.2d97c8p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.2d97c7f3321d3p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.2d97c7f3321d2p+1); + else return T(0x1.2d97c7f3321d2p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(three_pio_4_t, three_pio_4_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/three_pio_4.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(three_pio_4_, three_pio_4); - -namespace detail -{ - template - EVE_FORCEINLINE auto three_pio_4_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.2d97c8p+1); - else if constexpr( std::is_same_v ) return T(0x1.2d97c7f3321d2p+1); - } - - template - EVE_FORCEINLINE constexpr auto three_pio_4_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2d97c8p+1); - else if constexpr( std::is_same_v ) return T(0x1.2d97c7f3321d3p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.2d97c6p+1); - else if constexpr( std::is_same_v ) return T(0x1.2d97c7f3321d2p+1); - } - } -} +inline constexpr auto three_pio_4 = functor; } diff --git a/include/eve/module/math/constant/two_o_3.hpp b/include/eve/module/math/constant/two_o_3.hpp index 8b808474b3..5e4856b28d 100644 --- a/include/eve/module/math/constant/two_o_3.hpp +++ b/include/eve/module/math/constant/two_o_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct two_o_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.555556p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.555554p-1); + else return T(0x1.555556p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.5555555555556p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.5555555555555p-1); + else return T(0x1.5555555555555p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(two_o_3_t, two_o_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/two_o_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(two_o_3_, two_o_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto two_o_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.555556p-1); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-1); - } - - template - EVE_FORCEINLINE constexpr auto two_o_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555556p-1); - else if constexpr( std::is_same_v ) return T(0x1.5555555555556p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.555554p-1); - else if constexpr( std::is_same_v ) return T(0x1.5555555555555p-1); - } - } -} +inline constexpr auto two_o_3 = functor; } diff --git a/include/eve/module/math/constant/two_o_pi.hpp b/include/eve/module/math/constant/two_o_pi.hpp index e29d8c1e2f..e6a9cbbe61 100644 --- a/include/eve/module/math/constant/two_o_pi.hpp +++ b/include/eve/module/math/constant/two_o_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct two_o_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f308p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306p-1); + else return T(0x1.45f306p-1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.45f306dc9c883p-1); + else if constexpr(Opts::contains(downward2)) return T(0x1.45f306dc9c882p-1); + else return T(0x1.45f306dc9c883p-1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(two_o_pi_t, two_o_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/two_o_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(two_o_pi_, two_o_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto two_o_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.45f306p-1); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-1); - } - - template - EVE_FORCEINLINE constexpr auto two_o_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f308p-1); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c883p-1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.45f306p-1); - else if constexpr( std::is_same_v ) return T(0x1.45f306dc9c882p-1); - } - } -} +inline constexpr auto two_o_pi = functor; } diff --git a/include/eve/module/math/constant/two_o_sqrt_pi.hpp b/include/eve/module/math/constant/two_o_sqrt_pi.hpp index 19793c12d7..a27c246dd6 100644 --- a/include/eve/module/math/constant/two_o_sqrt_pi.hpp +++ b/include/eve/module/math/constant/two_o_sqrt_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct two_o_sqrt_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.20dd76p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.20dd74p+0); + else return T(0x1.20dd76p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.20dd750429b6ep+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.20dd750429b6dp+0); + else return T(0x1.20dd750429b6dp+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(two_o_sqrt_pi_t, two_o_sqrt_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/two_o_sqrt_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(two_o_sqrt_pi_, two_o_sqrt_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto two_o_sqrt_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.20dd76p+0); - else if constexpr( std::is_same_v ) return T(0x1.20dd750429b6dp+0); - } - - template - EVE_FORCEINLINE constexpr auto two_o_sqrt_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.20dd76p+0); - else if constexpr( std::is_same_v ) return T(0x1.20dd750429b6ep+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.20dd74p+0); - else if constexpr( std::is_same_v ) return T(0x1.20dd750429b6dp+0); - } - } -} +inline constexpr auto two_o_sqrt_pi = functor; } diff --git a/include/eve/module/math/constant/two_pi.hpp b/include/eve/module/math/constant/two_pi.hpp index 06a803fac2..bb9324a44e 100644 --- a/include/eve/module/math/constant/two_pi.hpp +++ b/include/eve/module/math/constant/two_pi.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct two_pi_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb6p+2); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb4p+2); + else return T(0x1.921fb6p+2); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.921fb54442d19p+2); + else if constexpr(Opts::contains(downward2)) return T(0x1.921fb54442d18p+2); + else return T(0x1.921fb54442d18p+2); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(two_pi_t, two_pi_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/two_pi.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(two_pi_, two_pi); - -namespace detail -{ - template - EVE_FORCEINLINE auto two_pi_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.921fb6p+2); - else if constexpr( std::is_same_v ) return T(0x1.921fb54442d18p+2); - } - - template - EVE_FORCEINLINE constexpr auto two_pi_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.921fb6p+2); - else if constexpr( std::is_same_v ) return T(0x1.921fb54442d19p+2); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.921fb4p+2); - else if constexpr( std::is_same_v ) return T(0x1.921fb54442d18p+2); - } - } -} +inline constexpr auto two_pi = functor; } diff --git a/include/eve/module/math/constant/two_pio_3.hpp b/include/eve/module/math/constant/two_pio_3.hpp index 9aa6a254d2..d205abf562 100644 --- a/include/eve/module/math/constant/two_pio_3.hpp +++ b/include/eve/module/math/constant/two_pio_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct two_pio_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c1524p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c1522p+1); + else return T(0x1.0c1524p+1); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.0c152382d7366p+1); + else if constexpr(Opts::contains(downward2)) return T(0x1.0c152382d7365p+1); + else return T(0x1.0c152382d7366p+1); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(two_pio_3_t, two_pio_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/two_pio_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(two_pio_3_, two_pio_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto two_pio_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.0c1524p+1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+1); - } - - template - EVE_FORCEINLINE constexpr auto two_pio_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1524p+1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7366p+1); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.0c1522p+1); - else if constexpr( std::is_same_v ) return T(0x1.0c152382d7365p+1); - } - } -} +inline constexpr auto two_pio_3 = functor; } diff --git a/include/eve/module/math/constant/zeta_2.hpp b/include/eve/module/math/constant/zeta_2.hpp index 0790555b05..1352a436a7 100644 --- a/include/eve/module/math/constant/zeta_2.hpp +++ b/include/eve/module/math/constant/zeta_2.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct zeta_2_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.a51a68p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a51a66p+0); + else return T(0x1.a51a66p+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.a51a6625307d4p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.a51a6625307d3p+0); + else return T(0x1.a51a6625307d3p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(zeta_2_t, zeta_2_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/zeta_2.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(zeta_2_, zeta_2); - -namespace detail -{ - template - EVE_FORCEINLINE auto zeta_2_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.a51a66p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d3p+0); - } - - template - EVE_FORCEINLINE constexpr auto zeta_2_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a51a68p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d4p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.a51a66p+0); - else if constexpr( std::is_same_v ) return T(0x1.a51a6625307d3p+0); - } - } -} +inline constexpr auto zeta_2 = functor; } diff --git a/include/eve/module/math/constant/zeta_3.hpp b/include/eve/module/math/constant/zeta_3.hpp index bad5739c02..e270165a40 100644 --- a/include/eve/module/math/constant/zeta_3.hpp +++ b/include/eve/module/math/constant/zeta_3.hpp @@ -7,10 +7,38 @@ //================================================================================================== #pragma once -#include +#include +#include +#include namespace eve { +template +struct zeta_3_t : constant_callable +{ + template + static EVE_FORCEINLINE constexpr T value(eve::as const&, Opts const&) + { + if constexpr(std::same_as, float>) + { + if constexpr(Opts::contains(upward2)) return T(0x1.33ba02p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.33bap+0); + else return T(0x1.33bap+0); + } + else + { + if constexpr(Opts::contains(upward2)) return T(0x1.33ba004f00622p+0); + else if constexpr(Opts::contains(downward2)) return T(0x1.33ba004f00621p+0); + else return T(0x1.33ba004f00621p+0); + } + } + + template + EVE_FORCEINLINE constexpr T operator()(as const& v) const { return EVE_DISPATCH_CALL(v); } + + EVE_CALLABLE_OBJECT(zeta_3_t, zeta_3_); +}; + //================================================================================================ //! @addtogroup math_constants //! @{ @@ -46,33 +74,5 @@ namespace eve //! @godbolt{doc/math/regular/zeta_3.cpp} //! @} //================================================================================================ -EVE_MAKE_CALLABLE(zeta_3_, zeta_3); - -namespace detail -{ - template - EVE_FORCEINLINE auto zeta_3_(EVE_SUPPORTS(cpu_), eve::as const&) noexcept - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) return T(0x1.33bap+0); - else if constexpr( std::is_same_v ) return T(0x1.33ba004f00621p+0); - } - - template - EVE_FORCEINLINE constexpr auto zeta_3_(EVE_SUPPORTS(cpu_), D const&, as const&) noexcept - requires(is_one_of(types {})) - { - using t_t = element_type_t; - if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.33ba02p+0); - else if constexpr( std::is_same_v ) return T(0x1.33ba004f00622p+0); - } - else if constexpr( std::is_same_v ) - { - if constexpr( std::is_same_v ) return T(0x1.33bap+0); - else if constexpr( std::is_same_v ) return T(0x1.33ba004f00621p+0); - } - } -} +inline constexpr auto zeta_3 = functor; } diff --git a/include/eve/module/math/regular/impl/cos.hpp b/include/eve/module/math/regular/impl/cos.hpp index 470a5ce1c4..53988f3131 100644 --- a/include/eve/module/math/regular/impl/cos.hpp +++ b/include/eve/module/math/regular/impl/cos.hpp @@ -29,7 +29,7 @@ cos_(EVE_SUPPORTS(cpu_), quarter_circle_type const&, T a0) noexcept if constexpr( has_native_abi_v ) { auto x2 = sqr(a0); - auto x2nlepi2_16 = is_not_less_equal(x2, upward(pi2o_16)(as(a0))); + auto x2nlepi2_16 = is_not_less_equal(x2, pi2o_16[upward](as(a0))); if constexpr( scalar_value ) return (x2nlepi2_16) ? nan(eve::as()) : cos_eval(x2); else return if_else(x2nlepi2_16, eve::allbits, cos_eval(x2)); } diff --git a/include/eve/traits/overload/protocol.hpp b/include/eve/traits/overload/protocol.hpp index b25342749d..70cbe28e7e 100644 --- a/include/eve/traits/overload/protocol.hpp +++ b/include/eve/traits/overload/protocol.hpp @@ -82,7 +82,7 @@ namespace eve //====================================================================================================================== #define EVE_CALLABLE_OBJECT_FROM(NS,TYPE,NAME) \ template \ -static EVE_FORCEINLINE auto deferred_call(auto arch, Args&&...args) noexcept \ +static EVE_FORCEINLINE constexpr auto deferred_call(auto arch, Args&&...args) noexcept \ -> decltype(NAME(NS::adl_helper, arch, EVE_FWD(args)...)) \ { \ return NAME( NS::adl_helper, arch, EVE_FWD(args)...); \ @@ -130,7 +130,7 @@ using callable_tag_type = TYPE //====================================================================================================================== #define EVE_CALLABLE_OBJECT(TYPE,NAME) \ template \ -static EVE_FORCEINLINE auto deferred_call(auto arch, Args&&...args) noexcept \ +static EVE_FORCEINLINE constexpr auto deferred_call(auto arch, Args&&...args) noexcept \ -> decltype(NAME(eve::detail::adl_helper, arch, EVE_FWD(args)...)) \ { \ return NAME(eve::detail::adl_helper, arch, EVE_FWD(args)...); \ diff --git a/include/eve/traits/overload/supports.hpp b/include/eve/traits/overload/supports.hpp index 4975f6c623..43309f44a8 100644 --- a/include/eve/traits/overload/supports.hpp +++ b/include/eve/traits/overload/supports.hpp @@ -119,14 +119,14 @@ namespace eve //! @return A new @callable with the options `o` set. //================================================================================================================== template - auto operator[](O o) const + constexpr auto operator[](O o) const requires( requires(OptionsValues const& ov) { this->process(ov,o);} ) { return process(static_cast(*this), o); } /// Retrieves the current options' state, including processed default - auto options() const + constexpr auto options() const { return kumi::fold_left( [&](auto acc, auto const& m) { return m.default_to(acc); } , kumi::tuple{} diff --git a/test/doc/math/regular/catalan.cpp b/test/doc/math/regular/catalan.cpp index d0419c1085..00410d13cd 100644 --- a/test/doc/math/regular/catalan.cpp +++ b/test/doc/math/regular/catalan.cpp @@ -8,23 +8,23 @@ using wide_dt = eve::wide; int main() { - wide_ft wxf; + wide_ft wxf([](auto i, auto){return eve::is_odd(i)?-1.f:1.f; ; }); wide_dt wxd; std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> catalan(as()) = " << eve::catalan(eve::as()) << std::endl << "-> catalan(as(wxf)) = " << eve::catalan(eve::as(wxf)) << std::endl - << "-> upward(catalan)(as()) = " << eve::upward(eve::catalan)(eve::as()) << std::endl - << "-> upward(catalan)(as(wxf)) = " << eve::upward(eve::catalan)(eve::as(wxf)) << std::endl - << "-> downward(catalan)(as()) = " << eve::downward(eve::catalan)(eve::as()) << std::endl - << "-> downward(catalan)(as(wxf)) = " << eve::downward(eve::catalan)(eve::as(wxf)) << std::endl + << "-> catalan[upward](as()) = " << eve::catalan[eve::upward](eve::as()) << std::endl + << "-> catalan[upward](as(wxf)) = " << eve::catalan[eve::upward](eve::as(wxf)) << std::endl + << "-> catalan[downward](as()) = " << eve::catalan[eve::downward](eve::as()) << std::endl + << "-> catalan[downward](as(wxf)) = " << eve::catalan[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> catalan(as()) = " << eve::catalan(eve::as()) << std::endl << "-> catalan(as(wxd)) = " << eve::catalan(eve::as(wxd)) << std::endl - << "-> upward(catalan)(as()) = " << eve::upward(eve::catalan)(eve::as()) << std::endl - << "-> upward(catalan)(as(wxd)) = " << eve::upward(eve::catalan)(eve::as(wxd)) << std::endl - << "-> downward(catalan)(as()) = " << eve::downward(eve::catalan)(eve::as()) << std::endl - << "-> downward(catalan)(as(wxd)) = " << eve::downward(eve::catalan)(eve::as(wxd)) << std::endl; + << "-> catalan[upward](as()) = " << eve::catalan[eve::upward](eve::as()) << std::endl + << "-> catalan[upward](as(wxd)) = " << eve::catalan[eve::upward](eve::as(wxd)) << std::endl + << "-> catalan[downward](as()) = " << eve::catalan[eve::downward](eve::as()) << std::endl + << "-> catalan[downward](as(wxd)) = " << eve::catalan[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; @@ -35,5 +35,9 @@ int main() << "-> catalan(as()) = " << eve::catalan(eve::as(double()))<< std::endl << "-> catalan(as catalan[wxf < 0.0f](as(wxf)) = " << eve::catalan[wxf < 0.0f](eve::as(wxf)) << std::endl + << "-> catalan[ignore_first(3)](as(wxf)) = " << eve::catalan[eve::ignore_first(3)](eve::as(wxf)) << std::endl; return 0; } diff --git a/test/doc/math/regular/cbrt_pi.cpp b/test/doc/math/regular/cbrt_pi.cpp index f65971fad0..030d18eb74 100644 --- a/test/doc/math/regular/cbrt_pi.cpp +++ b/test/doc/math/regular/cbrt_pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> cbrt_pi(as()) = " << eve::cbrt_pi(eve::as()) << std::endl << "-> cbrt_pi(as(wxf)) = " << eve::cbrt_pi(eve::as(wxf)) << std::endl - << "-> upward(cbrt_pi)(as()) = " << eve::upward(eve::cbrt_pi)(eve::as()) << std::endl - << "-> upward(cbrt_pi)(as(wxf)) = " << eve::upward(eve::cbrt_pi)(eve::as(wxf)) << std::endl - << "-> downward(cbrt_pi)(as()) = " << eve::downward(eve::cbrt_pi)(eve::as()) << std::endl - << "-> downward(cbrt_pi)(as(wxf)) = " << eve::downward(eve::cbrt_pi)(eve::as(wxf)) << std::endl + << "-> cbrt_pi[upward](as()) = " << eve::cbrt_pi[eve::upward](eve::as()) << std::endl + << "-> cbrt_pi[upward](as(wxf)) = " << eve::cbrt_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> cbrt_pi[downward](as()) = " << eve::cbrt_pi[eve::downward](eve::as()) << std::endl + << "-> cbrt_pi[downward](as(wxf)) = " << eve::cbrt_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> cbrt_pi(as()) = " << eve::cbrt_pi(eve::as()) << std::endl << "-> cbrt_pi(as(wxd)) = " << eve::cbrt_pi(eve::as(wxd)) << std::endl - << "-> upward(cbrt_pi)(as()) = " << eve::upward(eve::cbrt_pi)(eve::as()) << std::endl - << "-> upward(cbrt_pi)(as(wxd)) = " << eve::upward(eve::cbrt_pi)(eve::as(wxd)) << std::endl - << "-> downward(cbrt_pi)(as()) = " << eve::downward(eve::cbrt_pi)(eve::as()) << std::endl - << "-> downward(cbrt_pi)(as(wxd)) = " << eve::downward(eve::cbrt_pi)(eve::as(wxd)) << std::endl; + << "-> cbrt_pi[upward](as()) = " << eve::cbrt_pi[eve::upward](eve::as()) << std::endl + << "-> cbrt_pi[upward](as(wxd)) = " << eve::cbrt_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> cbrt_pi[downward](as()) = " << eve::cbrt_pi[eve::downward](eve::as()) << std::endl + << "-> cbrt_pi[downward](as(wxd)) = " << eve::cbrt_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/cos_1.cpp b/test/doc/math/regular/cos_1.cpp index 8a36920550..dd8ba9add8 100644 --- a/test/doc/math/regular/cos_1.cpp +++ b/test/doc/math/regular/cos_1.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> cos_1(as()) = " << eve::cos_1(eve::as()) << std::endl << "-> cos_1(as(wxf)) = " << eve::cos_1(eve::as(wxf)) << std::endl - << "-> upward(cos_1)(as()) = " << eve::upward(eve::cos_1)(eve::as()) << std::endl - << "-> upward(cos_1)(as(wxf)) = " << eve::upward(eve::cos_1)(eve::as(wxf)) << std::endl - << "-> downward(cos_1)(as()) = " << eve::downward(eve::cos_1)(eve::as()) << std::endl - << "-> downward(cos_1)(as(wxf)) = " << eve::downward(eve::cos_1)(eve::as(wxf)) << std::endl + << "-> cos_1[upward](as()) = " << eve::cos_1[eve::upward](eve::as()) << std::endl + << "-> cos_1[upward](as(wxf)) = " << eve::cos_1[eve::upward](eve::as(wxf)) << std::endl + << "-> cos_1[downward](as()) = " << eve::cos_1[eve::downward](eve::as()) << std::endl + << "-> cos_1[downward](as(wxf)) = " << eve::cos_1[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> cos_1(as()) = " << eve::cos_1(eve::as()) << std::endl << "-> cos_1(as(wxd)) = " << eve::cos_1(eve::as(wxd)) << std::endl - << "-> upward(cos_1)(as()) = " << eve::upward(eve::cos_1)(eve::as()) << std::endl - << "-> upward(cos_1)(as(wxd)) = " << eve::upward(eve::cos_1)(eve::as(wxd)) << std::endl - << "-> downward(cos_1)(as()) = " << eve::downward(eve::cos_1)(eve::as()) << std::endl - << "-> downward(cos_1)(as(wxd)) = " << eve::downward(eve::cos_1)(eve::as(wxd)) << std::endl; + << "-> cos_1[upward](as()) = " << eve::cos_1[eve::upward](eve::as()) << std::endl + << "-> cos_1[upward](as(wxd)) = " << eve::cos_1[eve::upward](eve::as(wxd)) << std::endl + << "-> cos_1[downward](as()) = " << eve::cos_1[eve::downward](eve::as()) << std::endl + << "-> cos_1[downward](as(wxd)) = " << eve::cos_1[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/cosh_1.cpp b/test/doc/math/regular/cosh_1.cpp index f11a87d290..1ca7f53b99 100644 --- a/test/doc/math/regular/cosh_1.cpp +++ b/test/doc/math/regular/cosh_1.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> cosh_1(as()) = " << eve::cosh_1(eve::as()) << std::endl << "-> cosh_1(as(wxf)) = " << eve::cosh_1(eve::as(wxf)) << std::endl - << "-> upward(cosh_1)(as()) = " << eve::upward(eve::cosh_1)(eve::as()) << std::endl - << "-> upward(cosh_1)(as(wxf)) = " << eve::upward(eve::cosh_1)(eve::as(wxf)) << std::endl - << "-> downward(cosh_1)(as()) = " << eve::downward(eve::cosh_1)(eve::as()) << std::endl - << "-> downward(cosh_1)(as(wxf)) = " << eve::downward(eve::cosh_1)(eve::as(wxf)) << std::endl + << "-> cosh_1[upward](as()) = " << eve::cosh_1[eve::upward](eve::as()) << std::endl + << "-> cosh_1[upward](as(wxf)) = " << eve::cosh_1[eve::upward](eve::as(wxf)) << std::endl + << "-> cosh_1[downward](as()) = " << eve::cosh_1[eve::downward](eve::as()) << std::endl + << "-> cosh_1[downward](as(wxf)) = " << eve::cosh_1[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> cosh_1(as()) = " << eve::cosh_1(eve::as()) << std::endl << "-> cosh_1(as(wxd)) = " << eve::cosh_1(eve::as(wxd)) << std::endl - << "-> upward(cosh_1)(as()) = " << eve::upward(eve::cosh_1)(eve::as()) << std::endl - << "-> upward(cosh_1)(as(wxd)) = " << eve::upward(eve::cosh_1)(eve::as(wxd)) << std::endl - << "-> downward(cosh_1)(as()) = " << eve::downward(eve::cosh_1)(eve::as()) << std::endl - << "-> downward(cosh_1)(as(wxd)) = " << eve::downward(eve::cosh_1)(eve::as(wxd)) << std::endl; + << "-> cosh_1[upward](as()) = " << eve::cosh_1[eve::upward](eve::as()) << std::endl + << "-> cosh_1[upward](as(wxd)) = " << eve::cosh_1[eve::upward](eve::as(wxd)) << std::endl + << "-> cosh_1[downward](as()) = " << eve::cosh_1[eve::downward](eve::as()) << std::endl + << "-> cosh_1[downward](as(wxd)) = " << eve::cosh_1[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/egamma_sqr.cpp b/test/doc/math/regular/egamma_sqr.cpp index 8ecd0a12c7..9fc2c54a47 100644 --- a/test/doc/math/regular/egamma_sqr.cpp +++ b/test/doc/math/regular/egamma_sqr.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> egamma_sqr(as()) = " << eve::egamma_sqr(eve::as()) << std::endl << "-> egamma_sqr(as(wxf)) = " << eve::egamma_sqr(eve::as(wxf)) << std::endl - << "-> upward(egamma_sqr)(as()) = " << eve::upward(eve::egamma_sqr)(eve::as()) << std::endl - << "-> upward(egamma_sqr)(as(wxf)) = " << eve::upward(eve::egamma_sqr)(eve::as(wxf)) << std::endl - << "-> downward(egamma_sqr)(as()) = " << eve::downward(eve::egamma_sqr)(eve::as()) << std::endl - << "-> downward(egamma_sqr)(as(wxf)) = " << eve::downward(eve::egamma_sqr)(eve::as(wxf)) << std::endl + << "-> egamma_sqr[upward](as()) = " << eve::egamma_sqr[eve::upward](eve::as()) << std::endl + << "-> egamma_sqr[upward](as(wxf)) = " << eve::egamma_sqr[eve::upward](eve::as(wxf)) << std::endl + << "-> egamma_sqr[downward](as()) = " << eve::egamma_sqr[eve::downward](eve::as()) << std::endl + << "-> egamma_sqr[downward](as(wxf)) = " << eve::egamma_sqr[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> egamma_sqr(as()) = " << eve::egamma_sqr(eve::as()) << std::endl << "-> egamma_sqr(as(wxd)) = " << eve::egamma_sqr(eve::as(wxd)) << std::endl - << "-> upward(egamma_sqr)(as()) = " << eve::upward(eve::egamma_sqr)(eve::as()) << std::endl - << "-> upward(egamma_sqr)(as(wxd)) = " << eve::upward(eve::egamma_sqr)(eve::as(wxd)) << std::endl - << "-> downward(egamma_sqr)(as()) = " << eve::downward(eve::egamma_sqr)(eve::as()) << std::endl - << "-> downward(egamma_sqr)(as(wxd)) = " << eve::downward(eve::egamma_sqr)(eve::as(wxd)) << std::endl; + << "-> egamma_sqr[upward](as()) = " << eve::egamma_sqr[eve::upward](eve::as()) << std::endl + << "-> egamma_sqr[upward](as(wxd)) = " << eve::egamma_sqr[eve::upward](eve::as(wxd)) << std::endl + << "-> egamma_sqr[downward](as()) = " << eve::egamma_sqr[eve::downward](eve::as()) << std::endl + << "-> egamma_sqr[downward](as(wxd)) = " << eve::egamma_sqr[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/exp_pi.cpp b/test/doc/math/regular/exp_pi.cpp index 5de15d971a..eb6aa0ff8d 100644 --- a/test/doc/math/regular/exp_pi.cpp +++ b/test/doc/math/regular/exp_pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> exp_pi(as()) = " << eve::exp_pi(eve::as()) << std::endl << "-> exp_pi(as(wxf)) = " << eve::exp_pi(eve::as(wxf)) << std::endl - << "-> upward(exp_pi)(as()) = " << eve::upward(eve::exp_pi)(eve::as()) << std::endl - << "-> upward(exp_pi)(as(wxf)) = " << eve::upward(eve::exp_pi)(eve::as(wxf)) << std::endl - << "-> downward(exp_pi)(as()) = " << eve::downward(eve::exp_pi)(eve::as()) << std::endl - << "-> downward(exp_pi)(as(wxf)) = " << eve::downward(eve::exp_pi)(eve::as(wxf)) << std::endl + << "-> exp_pi[upward](as()) = " << eve::exp_pi[eve::upward](eve::as()) << std::endl + << "-> exp_pi[upward](as(wxf)) = " << eve::exp_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> exp_pi[downward](as()) = " << eve::exp_pi[eve::downward](eve::as()) << std::endl + << "-> exp_pi[downward](as(wxf)) = " << eve::exp_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> exp_pi(as()) = " << eve::exp_pi(eve::as()) << std::endl << "-> exp_pi(as(wxd)) = " << eve::exp_pi(eve::as(wxd)) << std::endl - << "-> upward(exp_pi)(as()) = " << eve::upward(eve::exp_pi)(eve::as()) << std::endl - << "-> upward(exp_pi)(as(wxd)) = " << eve::upward(eve::exp_pi)(eve::as(wxd)) << std::endl - << "-> downward(exp_pi)(as()) = " << eve::downward(eve::exp_pi)(eve::as()) << std::endl - << "-> downward(exp_pi)(as(wxd)) = " << eve::downward(eve::exp_pi)(eve::as(wxd)) << std::endl; + << "-> exp_pi[upward](as()) = " << eve::exp_pi[eve::upward](eve::as()) << std::endl + << "-> exp_pi[upward](as(wxd)) = " << eve::exp_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> exp_pi[downward](as()) = " << eve::exp_pi[eve::downward](eve::as()) << std::endl + << "-> exp_pi[downward](as(wxd)) = " << eve::exp_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/extreme_value_skewness.cpp b/test/doc/math/regular/extreme_value_skewness.cpp deleted file mode 100644 index 04f855100a..0000000000 --- a/test/doc/math/regular/extreme_value_skewness.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include - -using wide_ft = eve::wide; -using wide_dt = eve::wide; - -int main() -{ - wide_ft wxf; - wide_dt wxd; - - std::cout << "---- simd" << std::setprecision(9) << std::endl - << "-> extreme_value_skewness(as()) = " << eve::extreme_value_skewness(eve::as()) << std::endl - << "-> extreme_value_skewness(as(wxf)) = " << eve::extreme_value_skewness(eve::as(wxf)) << std::endl - << "-> upward(extreme_value_skewness)(as()) = " << eve::upward(eve::extreme_value_skewness)(eve::as()) << std::endl - << "-> upward(extreme_value_skewness)(as(wxf)) = " << eve::upward(eve::extreme_value_skewness)(eve::as(wxf)) << std::endl - << "-> downward(extreme_value_skewness)(as()) = " << eve::downward(eve::extreme_value_skewness)(eve::as()) << std::endl - << "-> downward(extreme_value_skewness)(as(wxf)) = " << eve::downward(eve::extreme_value_skewness)(eve::as(wxf)) << std::endl - << std::setprecision(17) - << "-> extreme_value_skewness(as()) = " << eve::extreme_value_skewness(eve::as()) << std::endl - << "-> extreme_value_skewness(as(wxd)) = " << eve::extreme_value_skewness(eve::as(wxd)) << std::endl - << "-> upward(extreme_value_skewness)(as()) = " << eve::upward(eve::extreme_value_skewness)(eve::as()) << std::endl - << "-> upward(extreme_value_skewness)(as(wxd)) = " << eve::upward(eve::extreme_value_skewness)(eve::as(wxd)) << std::endl - << "-> downward(extreme_value_skewness)(as()) = " << eve::downward(eve::extreme_value_skewness)(eve::as()) << std::endl - << "-> downward(extreme_value_skewness)(as(wxd)) = " << eve::downward(eve::extreme_value_skewness)(eve::as(wxd)) << std::endl; - - float xf; - double xd; - - std::cout << "---- scalar" << std::endl - << "-> extreme_value_skewness(as()) = " << eve::extreme_value_skewness(eve::as(float())) << std::endl - << "-> extreme_value_skewness(as extreme_value_skewness(as()) = " << eve::extreme_value_skewness(eve::as(double()))<< std::endl - << "-> extreme_value_skewness(as four_minus_pi(as()) = " << eve::four_minus_pi(eve::as()) << std::endl << "-> four_minus_pi(as(wxf)) = " << eve::four_minus_pi(eve::as(wxf)) << std::endl - << "-> upward(four_minus_pi)(as()) = " << eve::upward(eve::four_minus_pi)(eve::as()) << std::endl - << "-> upward(four_minus_pi)(as(wxf)) = " << eve::upward(eve::four_minus_pi)(eve::as(wxf)) << std::endl - << "-> downward(four_minus_pi)(as()) = " << eve::downward(eve::four_minus_pi)(eve::as()) << std::endl - << "-> downward(four_minus_pi)(as(wxf)) = " << eve::downward(eve::four_minus_pi)(eve::as(wxf)) << std::endl + << "-> four_minus_pi[upward](as()) = " << eve::four_minus_pi[eve::upward](eve::as()) << std::endl + << "-> four_minus_pi[upward](as(wxf)) = " << eve::four_minus_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> four_minus_pi[downward](as()) = " << eve::four_minus_pi[eve::downward](eve::as()) << std::endl + << "-> four_minus_pi[downward](as(wxf)) = " << eve::four_minus_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> four_minus_pi(as()) = " << eve::four_minus_pi(eve::as()) << std::endl << "-> four_minus_pi(as(wxd)) = " << eve::four_minus_pi(eve::as(wxd)) << std::endl - << "-> upward(four_minus_pi)(as()) = " << eve::upward(eve::four_minus_pi)(eve::as()) << std::endl - << "-> upward(four_minus_pi)(as(wxd)) = " << eve::upward(eve::four_minus_pi)(eve::as(wxd)) << std::endl - << "-> downward(four_minus_pi)(as()) = " << eve::downward(eve::four_minus_pi)(eve::as()) << std::endl - << "-> downward(four_minus_pi)(as(wxd)) = " << eve::downward(eve::four_minus_pi)(eve::as(wxd)) << std::endl; + << "-> four_minus_pi[upward](as()) = " << eve::four_minus_pi[eve::upward](eve::as()) << std::endl + << "-> four_minus_pi[upward](as(wxd)) = " << eve::four_minus_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> four_minus_pi[downward](as()) = " << eve::four_minus_pi[eve::downward](eve::as()) << std::endl + << "-> four_minus_pi[downward](as(wxd)) = " << eve::four_minus_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/four_pio_3.cpp b/test/doc/math/regular/four_pio_3.cpp index 0d4c83653e..2aa3a7abe5 100644 --- a/test/doc/math/regular/four_pio_3.cpp +++ b/test/doc/math/regular/four_pio_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> four_pio_3(as()) = " << eve::four_pio_3(eve::as()) << std::endl << "-> four_pio_3(as(wxf)) = " << eve::four_pio_3(eve::as(wxf)) << std::endl - << "-> upward(four_pio_3)(as()) = " << eve::upward(eve::four_pio_3)(eve::as()) << std::endl - << "-> upward(four_pio_3)(as(wxf)) = " << eve::upward(eve::four_pio_3)(eve::as(wxf)) << std::endl - << "-> downward(four_pio_3)(as()) = " << eve::downward(eve::four_pio_3)(eve::as()) << std::endl - << "-> downward(four_pio_3)(as(wxf)) = " << eve::downward(eve::four_pio_3)(eve::as(wxf)) << std::endl + << "-> four_pio_3[upward](as()) = " << eve::four_pio_3[eve::upward](eve::as()) << std::endl + << "-> four_pio_3[upward](as(wxf)) = " << eve::four_pio_3[eve::upward](eve::as(wxf)) << std::endl + << "-> four_pio_3[downward](as()) = " << eve::four_pio_3[eve::downward](eve::as()) << std::endl + << "-> four_pio_3[downward](as(wxf)) = " << eve::four_pio_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> four_pio_3(as()) = " << eve::four_pio_3(eve::as()) << std::endl << "-> four_pio_3(as(wxd)) = " << eve::four_pio_3(eve::as(wxd)) << std::endl - << "-> upward(four_pio_3)(as()) = " << eve::upward(eve::four_pio_3)(eve::as()) << std::endl - << "-> upward(four_pio_3)(as(wxd)) = " << eve::upward(eve::four_pio_3)(eve::as(wxd)) << std::endl - << "-> downward(four_pio_3)(as()) = " << eve::downward(eve::four_pio_3)(eve::as()) << std::endl - << "-> downward(four_pio_3)(as(wxd)) = " << eve::downward(eve::four_pio_3)(eve::as(wxd)) << std::endl; + << "-> four_pio_3[upward](as()) = " << eve::four_pio_3[eve::upward](eve::as()) << std::endl + << "-> four_pio_3[upward](as(wxd)) = " << eve::four_pio_3[eve::upward](eve::as(wxd)) << std::endl + << "-> four_pio_3[downward](as()) = " << eve::four_pio_3[eve::downward](eve::as()) << std::endl + << "-> four_pio_3[downward](as(wxd)) = " << eve::four_pio_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/glaisher.cpp b/test/doc/math/regular/glaisher.cpp index 8a71c88bc3..0911bffd20 100644 --- a/test/doc/math/regular/glaisher.cpp +++ b/test/doc/math/regular/glaisher.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> glaisher(as()) = " << eve::glaisher(eve::as()) << std::endl << "-> glaisher(as(wxf)) = " << eve::glaisher(eve::as(wxf)) << std::endl - << "-> upward(glaisher)(as()) = " << eve::upward(eve::glaisher)(eve::as()) << std::endl - << "-> upward(glaisher)(as(wxf)) = " << eve::upward(eve::glaisher)(eve::as(wxf)) << std::endl - << "-> downward(glaisher)(as()) = " << eve::downward(eve::glaisher)(eve::as()) << std::endl - << "-> downward(glaisher)(as(wxf)) = " << eve::downward(eve::glaisher)(eve::as(wxf)) << std::endl + << "-> glaisher[upward](as()) = " << eve::glaisher[eve::upward](eve::as()) << std::endl + << "-> glaisher[upward](as(wxf)) = " << eve::glaisher[eve::upward](eve::as(wxf)) << std::endl + << "-> glaisher[downward](as()) = " << eve::glaisher[eve::downward](eve::as()) << std::endl + << "-> glaisher[downward](as(wxf)) = " << eve::glaisher[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> glaisher(as()) = " << eve::glaisher(eve::as()) << std::endl << "-> glaisher(as(wxd)) = " << eve::glaisher(eve::as(wxd)) << std::endl - << "-> upward(glaisher)(as()) = " << eve::upward(eve::glaisher)(eve::as()) << std::endl - << "-> upward(glaisher)(as(wxd)) = " << eve::upward(eve::glaisher)(eve::as(wxd)) << std::endl - << "-> downward(glaisher)(as()) = " << eve::downward(eve::glaisher)(eve::as()) << std::endl - << "-> downward(glaisher)(as(wxd)) = " << eve::downward(eve::glaisher)(eve::as(wxd)) << std::endl; + << "-> glaisher[upward](as()) = " << eve::glaisher[eve::upward](eve::as()) << std::endl + << "-> glaisher[upward](as(wxd)) = " << eve::glaisher[eve::upward](eve::as(wxd)) << std::endl + << "-> glaisher[downward](as()) = " << eve::glaisher[eve::downward](eve::as()) << std::endl + << "-> glaisher[downward](as(wxd)) = " << eve::glaisher[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/inv_2pi.cpp b/test/doc/math/regular/inv_2pi.cpp index eedbc7c83a..f565d58ca6 100644 --- a/test/doc/math/regular/inv_2pi.cpp +++ b/test/doc/math/regular/inv_2pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> inv_2pi(as()) = " << eve::inv_2pi(eve::as()) << std::endl << "-> inv_2pi(as(wxf)) = " << eve::inv_2pi(eve::as(wxf)) << std::endl - << "-> upward(inv_2pi)(as()) = " << eve::upward(eve::inv_2pi)(eve::as()) << std::endl - << "-> upward(inv_2pi)(as(wxf)) = " << eve::upward(eve::inv_2pi)(eve::as(wxf)) << std::endl - << "-> downward(inv_2pi)(as()) = " << eve::downward(eve::inv_2pi)(eve::as()) << std::endl - << "-> downward(inv_2pi)(as(wxf)) = " << eve::downward(eve::inv_2pi)(eve::as(wxf)) << std::endl + << "-> inv_2pi[upward](as()) = " << eve::inv_2pi[eve::upward](eve::as()) << std::endl + << "-> inv_2pi[upward](as(wxf)) = " << eve::inv_2pi[eve::upward](eve::as(wxf)) << std::endl + << "-> inv_2pi[downward](as()) = " << eve::inv_2pi[eve::downward](eve::as()) << std::endl + << "-> inv_2pi[downward](as(wxf)) = " << eve::inv_2pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> inv_2pi(as()) = " << eve::inv_2pi(eve::as()) << std::endl << "-> inv_2pi(as(wxd)) = " << eve::inv_2pi(eve::as(wxd)) << std::endl - << "-> upward(inv_2pi)(as()) = " << eve::upward(eve::inv_2pi)(eve::as()) << std::endl - << "-> upward(inv_2pi)(as(wxd)) = " << eve::upward(eve::inv_2pi)(eve::as(wxd)) << std::endl - << "-> downward(inv_2pi)(as()) = " << eve::downward(eve::inv_2pi)(eve::as()) << std::endl - << "-> downward(inv_2pi)(as(wxd)) = " << eve::downward(eve::inv_2pi)(eve::as(wxd)) << std::endl; + << "-> inv_2pi[upward](as()) = " << eve::inv_2pi[eve::upward](eve::as()) << std::endl + << "-> inv_2pi[upward](as(wxd)) = " << eve::inv_2pi[eve::upward](eve::as(wxd)) << std::endl + << "-> inv_2pi[downward](as()) = " << eve::inv_2pi[eve::downward](eve::as()) << std::endl + << "-> inv_2pi[downward](as(wxd)) = " << eve::inv_2pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/inv_e.cpp b/test/doc/math/regular/inv_e.cpp index 1f06739806..14b8c3f079 100644 --- a/test/doc/math/regular/inv_e.cpp +++ b/test/doc/math/regular/inv_e.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> inv_e(as()) = " << eve::inv_e(eve::as()) << std::endl << "-> inv_e(as(wxf)) = " << eve::inv_e(eve::as(wxf)) << std::endl - << "-> upward(inv_e)(as()) = " << eve::upward(eve::inv_e)(eve::as()) << std::endl - << "-> upward(inv_e)(as(wxf)) = " << eve::upward(eve::inv_e)(eve::as(wxf)) << std::endl - << "-> downward(inv_e)(as()) = " << eve::downward(eve::inv_e)(eve::as()) << std::endl - << "-> downward(inv_e)(as(wxf)) = " << eve::downward(eve::inv_e)(eve::as(wxf)) << std::endl + << "-> inv_e[upward](as()) = " << eve::inv_e[eve::upward](eve::as()) << std::endl + << "-> inv_e[upward](as(wxf)) = " << eve::inv_e[eve::upward](eve::as(wxf)) << std::endl + << "-> inv_e[downward](as()) = " << eve::inv_e[eve::downward](eve::as()) << std::endl + << "-> inv_e[downward](as(wxf)) = " << eve::inv_e[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> inv_e(as()) = " << eve::inv_e(eve::as()) << std::endl << "-> inv_e(as(wxd)) = " << eve::inv_e(eve::as(wxd)) << std::endl - << "-> upward(inv_e)(as()) = " << eve::upward(eve::inv_e)(eve::as()) << std::endl - << "-> upward(inv_e)(as(wxd)) = " << eve::upward(eve::inv_e)(eve::as(wxd)) << std::endl - << "-> downward(inv_e)(as()) = " << eve::downward(eve::inv_e)(eve::as()) << std::endl - << "-> downward(inv_e)(as(wxd)) = " << eve::downward(eve::inv_e)(eve::as(wxd)) << std::endl; + << "-> inv_e[upward](as()) = " << eve::inv_e[eve::upward](eve::as()) << std::endl + << "-> inv_e[upward](as(wxd)) = " << eve::inv_e[eve::upward](eve::as(wxd)) << std::endl + << "-> inv_e[downward](as()) = " << eve::inv_e[eve::downward](eve::as()) << std::endl + << "-> inv_e[downward](as(wxd)) = " << eve::inv_e[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/inv_egamma.cpp b/test/doc/math/regular/inv_egamma.cpp index f70abf5c10..ea0c633f00 100644 --- a/test/doc/math/regular/inv_egamma.cpp +++ b/test/doc/math/regular/inv_egamma.cpp @@ -10,8 +10,8 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> inv_egamma(as()) = " << eve::inv_egamma(eve::as()) << std::endl - << "-> upward(inv_egamma)(as()) = " << eve::upward(eve::inv_egamma)(eve::as()) << std::endl - << "-> downward(inv_egamma)(as()) = " << eve::downward(eve::inv_egamma)(eve::as()) << std::endl; + << "-> inv_egamma[upward](as()) = " << eve::inv_egamma[eve::upward](eve::as()) << std::endl + << "-> inv_egamma[downward](as()) = " << eve::inv_egamma[eve::downward](eve::as()) << std::endl; std::cout << "---- scalar" << std::endl diff --git a/test/doc/math/regular/invcbrt_pi.cpp b/test/doc/math/regular/invcbrt_pi.cpp index 4a3ad07ee8..3d02130086 100644 --- a/test/doc/math/regular/invcbrt_pi.cpp +++ b/test/doc/math/regular/invcbrt_pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> invcbrt_pi(as()) = " << eve::invcbrt_pi(eve::as()) << std::endl << "-> invcbrt_pi(as(wxf)) = " << eve::invcbrt_pi(eve::as(wxf)) << std::endl - << "-> upward(invcbrt_pi)(as()) = " << eve::upward(eve::invcbrt_pi)(eve::as()) << std::endl - << "-> upward(invcbrt_pi)(as(wxf)) = " << eve::upward(eve::invcbrt_pi)(eve::as(wxf)) << std::endl - << "-> downward(invcbrt_pi)(as()) = " << eve::downward(eve::invcbrt_pi)(eve::as()) << std::endl - << "-> downward(invcbrt_pi)(as(wxf)) = " << eve::downward(eve::invcbrt_pi)(eve::as(wxf)) << std::endl + << "-> invcbrt_pi[upward](as()) = " << eve::invcbrt_pi[eve::upward](eve::as()) << std::endl + << "-> invcbrt_pi[upward](as(wxf)) = " << eve::invcbrt_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> invcbrt_pi[downward](as()) = " << eve::invcbrt_pi[eve::downward](eve::as()) << std::endl + << "-> invcbrt_pi[downward](as(wxf)) = " << eve::invcbrt_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> invcbrt_pi(as()) = " << eve::invcbrt_pi(eve::as()) << std::endl << "-> invcbrt_pi(as(wxd)) = " << eve::invcbrt_pi(eve::as(wxd)) << std::endl - << "-> upward(invcbrt_pi)(as()) = " << eve::upward(eve::invcbrt_pi)(eve::as()) << std::endl - << "-> upward(invcbrt_pi)(as(wxd)) = " << eve::upward(eve::invcbrt_pi)(eve::as(wxd)) << std::endl - << "-> downward(invcbrt_pi)(as()) = " << eve::downward(eve::invcbrt_pi)(eve::as()) << std::endl - << "-> downward(invcbrt_pi)(as(wxd)) = " << eve::downward(eve::invcbrt_pi)(eve::as(wxd)) << std::endl; + << "-> invcbrt_pi[upward](as()) = " << eve::invcbrt_pi[eve::upward](eve::as()) << std::endl + << "-> invcbrt_pi[upward](as(wxd)) = " << eve::invcbrt_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> invcbrt_pi[downward](as()) = " << eve::invcbrt_pi[eve::downward](eve::as()) << std::endl + << "-> invcbrt_pi[downward](as(wxd)) = " << eve::invcbrt_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/invlog10_e.cpp b/test/doc/math/regular/invlog10_e.cpp index 8142ad0eb5..f8f5461621 100644 --- a/test/doc/math/regular/invlog10_e.cpp +++ b/test/doc/math/regular/invlog10_e.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> invlog10_e(as()) = " << eve::invlog10_e(eve::as()) << std::endl << "-> invlog10_e(as(wxf)) = " << eve::invlog10_e(eve::as(wxf)) << std::endl - << "-> upward(invlog10_e)(as()) = " << eve::upward(eve::invlog10_e)(eve::as()) << std::endl - << "-> upward(invlog10_e)(as(wxf)) = " << eve::upward(eve::invlog10_e)(eve::as(wxf)) << std::endl - << "-> downward(invlog10_e)(as()) = " << eve::downward(eve::invlog10_e)(eve::as()) << std::endl - << "-> downward(invlog10_e)(as(wxf)) = " << eve::downward(eve::invlog10_e)(eve::as(wxf)) << std::endl + << "-> invlog10_e[upward](as()) = " << eve::invlog10_e[eve::upward](eve::as()) << std::endl + << "-> invlog10_e[upward](as(wxf)) = " << eve::invlog10_e[eve::upward](eve::as(wxf)) << std::endl + << "-> invlog10_e[downward](as()) = " << eve::invlog10_e[eve::downward](eve::as()) << std::endl + << "-> invlog10_e[downward](as(wxf)) = " << eve::invlog10_e[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> invlog10_e(as()) = " << eve::invlog10_e(eve::as()) << std::endl << "-> invlog10_e(as(wxd)) = " << eve::invlog10_e(eve::as(wxd)) << std::endl - << "-> upward(invlog10_e)(as()) = " << eve::upward(eve::invlog10_e)(eve::as()) << std::endl - << "-> upward(invlog10_e)(as(wxd)) = " << eve::upward(eve::invlog10_e)(eve::as(wxd)) << std::endl - << "-> downward(invlog10_e)(as()) = " << eve::downward(eve::invlog10_e)(eve::as()) << std::endl - << "-> downward(invlog10_e)(as(wxd)) = " << eve::downward(eve::invlog10_e)(eve::as(wxd)) << std::endl; + << "-> invlog10_e[upward](as()) = " << eve::invlog10_e[eve::upward](eve::as()) << std::endl + << "-> invlog10_e[upward](as(wxd)) = " << eve::invlog10_e[eve::upward](eve::as(wxd)) << std::endl + << "-> invlog10_e[downward](as()) = " << eve::invlog10_e[eve::downward](eve::as()) << std::endl + << "-> invlog10_e[downward](as(wxd)) = " << eve::invlog10_e[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/invlog_phi.cpp b/test/doc/math/regular/invlog_phi.cpp index 524f1eae03..eb8939bedc 100644 --- a/test/doc/math/regular/invlog_phi.cpp +++ b/test/doc/math/regular/invlog_phi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> invlog_phi(as()) = " << eve::invlog_phi(eve::as()) << std::endl << "-> invlog_phi(as(wxf)) = " << eve::invlog_phi(eve::as(wxf)) << std::endl - << "-> upward(invlog_phi)(as()) = " << eve::upward(eve::invlog_phi)(eve::as()) << std::endl - << "-> upward(invlog_phi)(as(wxf)) = " << eve::upward(eve::invlog_phi)(eve::as(wxf)) << std::endl - << "-> downward(invlog_phi)(as()) = " << eve::downward(eve::invlog_phi)(eve::as()) << std::endl - << "-> downward(invlog_phi)(as(wxf)) = " << eve::downward(eve::invlog_phi)(eve::as(wxf)) << std::endl + << "-> invlog_phi[upward](as()) = " << eve::invlog_phi[eve::upward](eve::as()) << std::endl + << "-> invlog_phi[upward](as(wxf)) = " << eve::invlog_phi[eve::upward](eve::as(wxf)) << std::endl + << "-> invlog_phi[downward](as()) = " << eve::invlog_phi[eve::downward](eve::as()) << std::endl + << "-> invlog_phi[downward](as(wxf)) = " << eve::invlog_phi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> invlog_phi(as()) = " << eve::invlog_phi(eve::as()) << std::endl << "-> invlog_phi(as(wxd)) = " << eve::invlog_phi(eve::as(wxd)) << std::endl - << "-> upward(invlog_phi)(as()) = " << eve::upward(eve::invlog_phi)(eve::as()) << std::endl - << "-> upward(invlog_phi)(as(wxd)) = " << eve::upward(eve::invlog_phi)(eve::as(wxd)) << std::endl - << "-> downward(invlog_phi)(as()) = " << eve::downward(eve::invlog_phi)(eve::as()) << std::endl - << "-> downward(invlog_phi)(as(wxd)) = " << eve::downward(eve::invlog_phi)(eve::as(wxd)) << std::endl; + << "-> invlog_phi[upward](as()) = " << eve::invlog_phi[eve::upward](eve::as()) << std::endl + << "-> invlog_phi[upward](as(wxd)) = " << eve::invlog_phi[eve::upward](eve::as(wxd)) << std::endl + << "-> invlog_phi[downward](as()) = " << eve::invlog_phi[eve::downward](eve::as()) << std::endl + << "-> invlog_phi[downward](as(wxd)) = " << eve::invlog_phi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/khinchin.cpp b/test/doc/math/regular/khinchin.cpp index 360d87c6b0..4f57996999 100644 --- a/test/doc/math/regular/khinchin.cpp +++ b/test/doc/math/regular/khinchin.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> khinchin(as()) = " << eve::khinchin(eve::as()) << std::endl << "-> khinchin(as(wxf)) = " << eve::khinchin(eve::as(wxf)) << std::endl - << "-> upward(khinchin)(as()) = " << eve::upward(eve::khinchin)(eve::as()) << std::endl - << "-> upward(khinchin)(as(wxf)) = " << eve::upward(eve::khinchin)(eve::as(wxf)) << std::endl - << "-> downward(khinchin)(as()) = " << eve::downward(eve::khinchin)(eve::as()) << std::endl - << "-> downward(khinchin)(as(wxf)) = " << eve::downward(eve::khinchin)(eve::as(wxf)) << std::endl + << "-> khinchin[upward](as()) = " << eve::khinchin[eve::upward](eve::as()) << std::endl + << "-> khinchin[upward](as(wxf)) = " << eve::khinchin[eve::upward](eve::as(wxf)) << std::endl + << "-> khinchin[downward](as()) = " << eve::khinchin[eve::downward](eve::as()) << std::endl + << "-> khinchin[downward](as(wxf)) = " << eve::khinchin[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> khinchin(as()) = " << eve::khinchin(eve::as()) << std::endl << "-> khinchin(as(wxd)) = " << eve::khinchin(eve::as(wxd)) << std::endl - << "-> upward(khinchin)(as()) = " << eve::upward(eve::khinchin)(eve::as()) << std::endl - << "-> upward(khinchin)(as(wxd)) = " << eve::upward(eve::khinchin)(eve::as(wxd)) << std::endl - << "-> downward(khinchin)(as()) = " << eve::downward(eve::khinchin)(eve::as()) << std::endl - << "-> downward(khinchin)(as(wxd)) = " << eve::downward(eve::khinchin)(eve::as(wxd)) << std::endl; + << "-> khinchin[upward](as()) = " << eve::khinchin[eve::upward](eve::as()) << std::endl + << "-> khinchin[upward](as(wxd)) = " << eve::khinchin[eve::upward](eve::as(wxd)) << std::endl + << "-> khinchin[downward](as()) = " << eve::khinchin[eve::downward](eve::as()) << std::endl + << "-> khinchin[downward](as(wxd)) = " << eve::khinchin[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/log_phi.cpp b/test/doc/math/regular/log_phi.cpp index 50f7539868..aff076cd50 100644 --- a/test/doc/math/regular/log_phi.cpp +++ b/test/doc/math/regular/log_phi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> log_phi(as()) = " << eve::log_phi(eve::as()) << std::endl << "-> log_phi(as(wxf)) = " << eve::log_phi(eve::as(wxf)) << std::endl - << "-> upward(log_phi)(as()) = " << eve::upward(eve::log_phi)(eve::as()) << std::endl - << "-> upward(log_phi)(as(wxf)) = " << eve::upward(eve::log_phi)(eve::as(wxf)) << std::endl - << "-> downward(log_phi)(as()) = " << eve::downward(eve::log_phi)(eve::as()) << std::endl - << "-> downward(log_phi)(as(wxf)) = " << eve::downward(eve::log_phi)(eve::as(wxf)) << std::endl + << "-> log_phi[upward](as()) = " << eve::log_phi[eve::upward](eve::as()) << std::endl + << "-> log_phi[upward](as(wxf)) = " << eve::log_phi[eve::upward](eve::as(wxf)) << std::endl + << "-> log_phi[downward](as()) = " << eve::log_phi[eve::downward](eve::as()) << std::endl + << "-> log_phi[downward](as(wxf)) = " << eve::log_phi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> log_phi(as()) = " << eve::log_phi(eve::as()) << std::endl << "-> log_phi(as(wxd)) = " << eve::log_phi(eve::as(wxd)) << std::endl - << "-> upward(log_phi)(as()) = " << eve::upward(eve::log_phi)(eve::as()) << std::endl - << "-> upward(log_phi)(as(wxd)) = " << eve::upward(eve::log_phi)(eve::as(wxd)) << std::endl - << "-> downward(log_phi)(as()) = " << eve::downward(eve::log_phi)(eve::as()) << std::endl - << "-> downward(log_phi)(as(wxd)) = " << eve::downward(eve::log_phi)(eve::as(wxd)) << std::endl; + << "-> log_phi[upward](as()) = " << eve::log_phi[eve::upward](eve::as()) << std::endl + << "-> log_phi[upward](as(wxd)) = " << eve::log_phi[eve::upward](eve::as(wxd)) << std::endl + << "-> log_phi[downward](as()) = " << eve::log_phi[eve::downward](eve::as()) << std::endl + << "-> log_phi[downward](as(wxd)) = " << eve::log_phi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/loglog_2.cpp b/test/doc/math/regular/loglog_2.cpp index efac8f15f8..6241056649 100644 --- a/test/doc/math/regular/loglog_2.cpp +++ b/test/doc/math/regular/loglog_2.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> loglog_2(as()) = " << eve::loglog_2(eve::as()) << std::endl << "-> loglog_2(as(wxf)) = " << eve::loglog_2(eve::as(wxf)) << std::endl - << "-> upward(loglog_2)(as()) = " << eve::upward(eve::loglog_2)(eve::as()) << std::endl - << "-> upward(loglog_2)(as(wxf)) = " << eve::upward(eve::loglog_2)(eve::as(wxf)) << std::endl - << "-> downward(loglog_2)(as()) = " << eve::downward(eve::loglog_2)(eve::as()) << std::endl - << "-> downward(loglog_2)(as(wxf)) = " << eve::downward(eve::loglog_2)(eve::as(wxf)) << std::endl + << "-> loglog_2[upward](as()) = " << eve::loglog_2[eve::upward](eve::as()) << std::endl + << "-> loglog_2[upward](as(wxf)) = " << eve::loglog_2[eve::upward](eve::as(wxf)) << std::endl + << "-> loglog_2[downward](as()) = " << eve::loglog_2[eve::downward](eve::as()) << std::endl + << "-> loglog_2[downward](as(wxf)) = " << eve::loglog_2[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> loglog_2(as()) = " << eve::loglog_2(eve::as()) << std::endl << "-> loglog_2(as(wxd)) = " << eve::loglog_2(eve::as(wxd)) << std::endl - << "-> upward(loglog_2)(as()) = " << eve::upward(eve::loglog_2)(eve::as()) << std::endl - << "-> upward(loglog_2)(as(wxd)) = " << eve::upward(eve::loglog_2)(eve::as(wxd)) << std::endl - << "-> downward(loglog_2)(as()) = " << eve::downward(eve::loglog_2)(eve::as()) << std::endl - << "-> downward(loglog_2)(as(wxd)) = " << eve::downward(eve::loglog_2)(eve::as(wxd)) << std::endl; + << "-> loglog_2[upward](as()) = " << eve::loglog_2[eve::upward](eve::as()) << std::endl + << "-> loglog_2[upward](as(wxd)) = " << eve::loglog_2[eve::upward](eve::as(wxd)) << std::endl + << "-> loglog_2[downward](as()) = " << eve::loglog_2[eve::downward](eve::as()) << std::endl + << "-> loglog_2[downward](as(wxd)) = " << eve::loglog_2[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi2.cpp b/test/doc/math/regular/pi2.cpp index 1cb409f98d..44945db9a8 100644 --- a/test/doc/math/regular/pi2.cpp +++ b/test/doc/math/regular/pi2.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi2(as()) = " << eve::pi2(eve::as()) << std::endl << "-> pi2(as(wxf)) = " << eve::pi2(eve::as(wxf)) << std::endl - << "-> upward(pi2)(as()) = " << eve::upward(eve::pi2)(eve::as()) << std::endl - << "-> upward(pi2)(as(wxf)) = " << eve::upward(eve::pi2)(eve::as(wxf)) << std::endl - << "-> downward(pi2)(as()) = " << eve::downward(eve::pi2)(eve::as()) << std::endl - << "-> downward(pi2)(as(wxf)) = " << eve::downward(eve::pi2)(eve::as(wxf)) << std::endl + << "-> pi2[upward](as()) = " << eve::pi2[eve::upward](eve::as()) << std::endl + << "-> pi2[upward](as(wxf)) = " << eve::pi2[eve::upward](eve::as(wxf)) << std::endl + << "-> pi2[downward](as()) = " << eve::pi2[eve::downward](eve::as()) << std::endl + << "-> pi2[downward](as(wxf)) = " << eve::pi2[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi2(as()) = " << eve::pi2(eve::as()) << std::endl << "-> pi2(as(wxd)) = " << eve::pi2(eve::as(wxd)) << std::endl - << "-> upward(pi2)(as()) = " << eve::upward(eve::pi2)(eve::as()) << std::endl - << "-> upward(pi2)(as(wxd)) = " << eve::upward(eve::pi2)(eve::as(wxd)) << std::endl - << "-> downward(pi2)(as()) = " << eve::downward(eve::pi2)(eve::as()) << std::endl - << "-> downward(pi2)(as(wxd)) = " << eve::downward(eve::pi2)(eve::as(wxd)) << std::endl; + << "-> pi2[upward](as()) = " << eve::pi2[eve::upward](eve::as()) << std::endl + << "-> pi2[upward](as(wxd)) = " << eve::pi2[eve::upward](eve::as(wxd)) << std::endl + << "-> pi2[downward](as()) = " << eve::pi2[eve::downward](eve::as()) << std::endl + << "-> pi2[downward](as(wxd)) = " << eve::pi2[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi2o_16.cpp b/test/doc/math/regular/pi2o_16.cpp index 5d70327074..6ba502899e 100644 --- a/test/doc/math/regular/pi2o_16.cpp +++ b/test/doc/math/regular/pi2o_16.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi2o_16(as()) = " << eve::pi2o_16(eve::as()) << std::endl << "-> pi2o_16(as(wxf)) = " << eve::pi2o_16(eve::as(wxf)) << std::endl - << "-> upward(pi2o_16)(as()) = " << eve::upward(eve::pi2o_16)(eve::as()) << std::endl - << "-> upward(pi2o_16)(as(wxf)) = " << eve::upward(eve::pi2o_16)(eve::as(wxf)) << std::endl - << "-> downward(pi2o_16)(as()) = " << eve::downward(eve::pi2o_16)(eve::as()) << std::endl - << "-> downward(pi2o_16)(as(wxf)) = " << eve::downward(eve::pi2o_16)(eve::as(wxf)) << std::endl + << "-> pi2o_16[upward](as()) = " << eve::pi2o_16[eve::upward](eve::as()) << std::endl + << "-> pi2o_16[upward](as(wxf)) = " << eve::pi2o_16[eve::upward](eve::as(wxf)) << std::endl + << "-> pi2o_16[downward](as()) = " << eve::pi2o_16[eve::downward](eve::as()) << std::endl + << "-> pi2o_16[downward](as(wxf)) = " << eve::pi2o_16[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi2o_16(as()) = " << eve::pi2o_16(eve::as()) << std::endl << "-> pi2o_16(as(wxd)) = " << eve::pi2o_16(eve::as(wxd)) << std::endl - << "-> upward(pi2o_16)(as()) = " << eve::upward(eve::pi2o_16)(eve::as()) << std::endl - << "-> upward(pi2o_16)(as(wxd)) = " << eve::upward(eve::pi2o_16)(eve::as(wxd)) << std::endl - << "-> downward(pi2o_16)(as()) = " << eve::downward(eve::pi2o_16)(eve::as()) << std::endl - << "-> downward(pi2o_16)(as(wxd)) = " << eve::downward(eve::pi2o_16)(eve::as(wxd)) << std::endl; + << "-> pi2o_16[upward](as()) = " << eve::pi2o_16[eve::upward](eve::as()) << std::endl + << "-> pi2o_16[upward](as(wxd)) = " << eve::pi2o_16[eve::upward](eve::as(wxd)) << std::endl + << "-> pi2o_16[downward](as()) = " << eve::pi2o_16[eve::downward](eve::as()) << std::endl + << "-> pi2o_16[downward](as(wxd)) = " << eve::pi2o_16[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi2o_6.cpp b/test/doc/math/regular/pi2o_6.cpp index ce52a9191c..19119842ed 100644 --- a/test/doc/math/regular/pi2o_6.cpp +++ b/test/doc/math/regular/pi2o_6.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi2o_6(as()) = " << eve::pi2o_6(eve::as()) << std::endl << "-> pi2o_6(as(wxf)) = " << eve::pi2o_6(eve::as(wxf)) << std::endl - << "-> upward(pi2o_6)(as()) = " << eve::upward(eve::pi2o_6)(eve::as()) << std::endl - << "-> upward(pi2o_6)(as(wxf)) = " << eve::upward(eve::pi2o_6)(eve::as(wxf)) << std::endl - << "-> downward(pi2o_6)(as()) = " << eve::downward(eve::pi2o_6)(eve::as()) << std::endl - << "-> downward(pi2o_6)(as(wxf)) = " << eve::downward(eve::pi2o_6)(eve::as(wxf)) << std::endl + << "-> pi2o_6[upward](as()) = " << eve::pi2o_6[eve::upward](eve::as()) << std::endl + << "-> pi2o_6[upward](as(wxf)) = " << eve::pi2o_6[eve::upward](eve::as(wxf)) << std::endl + << "-> pi2o_6[downward](as()) = " << eve::pi2o_6[eve::downward](eve::as()) << std::endl + << "-> pi2o_6[downward](as(wxf)) = " << eve::pi2o_6[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi2o_6(as()) = " << eve::pi2o_6(eve::as()) << std::endl << "-> pi2o_6(as(wxd)) = " << eve::pi2o_6(eve::as(wxd)) << std::endl - << "-> upward(pi2o_6)(as()) = " << eve::upward(eve::pi2o_6)(eve::as()) << std::endl - << "-> upward(pi2o_6)(as(wxd)) = " << eve::upward(eve::pi2o_6)(eve::as(wxd)) << std::endl - << "-> downward(pi2o_6)(as()) = " << eve::downward(eve::pi2o_6)(eve::as()) << std::endl - << "-> downward(pi2o_6)(as(wxd)) = " << eve::downward(eve::pi2o_6)(eve::as(wxd)) << std::endl; + << "-> pi2o_6[upward](as()) = " << eve::pi2o_6[eve::upward](eve::as()) << std::endl + << "-> pi2o_6[upward](as(wxd)) = " << eve::pi2o_6[eve::upward](eve::as(wxd)) << std::endl + << "-> pi2o_6[downward](as()) = " << eve::pi2o_6[eve::downward](eve::as()) << std::endl + << "-> pi2o_6[downward](as(wxd)) = " << eve::pi2o_6[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi3.cpp b/test/doc/math/regular/pi3.cpp index 556abdda82..9bd198cd6c 100644 --- a/test/doc/math/regular/pi3.cpp +++ b/test/doc/math/regular/pi3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi3(as()) = " << eve::pi3(eve::as()) << std::endl << "-> pi3(as(wxf)) = " << eve::pi3(eve::as(wxf)) << std::endl - << "-> upward(pi3)(as()) = " << eve::upward(eve::pi3)(eve::as()) << std::endl - << "-> upward(pi3)(as(wxf)) = " << eve::upward(eve::pi3)(eve::as(wxf)) << std::endl - << "-> downward(pi3)(as()) = " << eve::downward(eve::pi3)(eve::as()) << std::endl - << "-> downward(pi3)(as(wxf)) = " << eve::downward(eve::pi3)(eve::as(wxf)) << std::endl + << "-> pi3[upward](as()) = " << eve::pi3[eve::upward](eve::as()) << std::endl + << "-> pi3[upward](as(wxf)) = " << eve::pi3[eve::upward](eve::as(wxf)) << std::endl + << "-> pi3[downward](as()) = " << eve::pi3[eve::downward](eve::as()) << std::endl + << "-> pi3[downward](as(wxf)) = " << eve::pi3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi3(as()) = " << eve::pi3(eve::as()) << std::endl << "-> pi3(as(wxd)) = " << eve::pi3(eve::as(wxd)) << std::endl - << "-> upward(pi3)(as()) = " << eve::upward(eve::pi3)(eve::as()) << std::endl - << "-> upward(pi3)(as(wxd)) = " << eve::upward(eve::pi3)(eve::as(wxd)) << std::endl - << "-> downward(pi3)(as()) = " << eve::downward(eve::pi3)(eve::as()) << std::endl - << "-> downward(pi3)(as(wxd)) = " << eve::downward(eve::pi3)(eve::as(wxd)) << std::endl; + << "-> pi3[upward](as()) = " << eve::pi3[eve::upward](eve::as()) << std::endl + << "-> pi3[upward](as(wxd)) = " << eve::pi3[eve::upward](eve::as(wxd)) << std::endl + << "-> pi3[downward](as()) = " << eve::pi3[eve::downward](eve::as()) << std::endl + << "-> pi3[downward](as(wxd)) = " << eve::pi3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi_minus_3.cpp b/test/doc/math/regular/pi_minus_3.cpp index 08eeb70e03..66d2773495 100644 --- a/test/doc/math/regular/pi_minus_3.cpp +++ b/test/doc/math/regular/pi_minus_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi_minus_3(as()) = " << eve::pi_minus_3(eve::as()) << std::endl << "-> pi_minus_3(as(wxf)) = " << eve::pi_minus_3(eve::as(wxf)) << std::endl - << "-> upward(pi_minus_3)(as()) = " << eve::upward(eve::pi_minus_3)(eve::as()) << std::endl - << "-> upward(pi_minus_3)(as(wxf)) = " << eve::upward(eve::pi_minus_3)(eve::as(wxf)) << std::endl - << "-> downward(pi_minus_3)(as()) = " << eve::downward(eve::pi_minus_3)(eve::as()) << std::endl - << "-> downward(pi_minus_3)(as(wxf)) = " << eve::downward(eve::pi_minus_3)(eve::as(wxf)) << std::endl + << "-> pi_minus_3[upward](as()) = " << eve::pi_minus_3[eve::upward](eve::as()) << std::endl + << "-> pi_minus_3[upward](as(wxf)) = " << eve::pi_minus_3[eve::upward](eve::as(wxf)) << std::endl + << "-> pi_minus_3[downward](as()) = " << eve::pi_minus_3[eve::downward](eve::as()) << std::endl + << "-> pi_minus_3[downward](as(wxf)) = " << eve::pi_minus_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi_minus_3(as()) = " << eve::pi_minus_3(eve::as()) << std::endl << "-> pi_minus_3(as(wxd)) = " << eve::pi_minus_3(eve::as(wxd)) << std::endl - << "-> upward(pi_minus_3)(as()) = " << eve::upward(eve::pi_minus_3)(eve::as()) << std::endl - << "-> upward(pi_minus_3)(as(wxd)) = " << eve::upward(eve::pi_minus_3)(eve::as(wxd)) << std::endl - << "-> downward(pi_minus_3)(as()) = " << eve::downward(eve::pi_minus_3)(eve::as()) << std::endl - << "-> downward(pi_minus_3)(as(wxd)) = " << eve::downward(eve::pi_minus_3)(eve::as(wxd)) << std::endl; + << "-> pi_minus_3[upward](as()) = " << eve::pi_minus_3[eve::upward](eve::as()) << std::endl + << "-> pi_minus_3[upward](as(wxd)) = " << eve::pi_minus_3[eve::upward](eve::as(wxd)) << std::endl + << "-> pi_minus_3[downward](as()) = " << eve::pi_minus_3[eve::downward](eve::as()) << std::endl + << "-> pi_minus_3[downward](as(wxd)) = " << eve::pi_minus_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pi_pow_e.cpp b/test/doc/math/regular/pi_pow_e.cpp index b46160bb69..a264c415b7 100644 --- a/test/doc/math/regular/pi_pow_e.cpp +++ b/test/doc/math/regular/pi_pow_e.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pi_pow_e(as()) = " << eve::pi_pow_e(eve::as()) << std::endl << "-> pi_pow_e(as(wxf)) = " << eve::pi_pow_e(eve::as(wxf)) << std::endl - << "-> upward(pi_pow_e)(as()) = " << eve::upward(eve::pi_pow_e)(eve::as()) << std::endl - << "-> upward(pi_pow_e)(as(wxf)) = " << eve::upward(eve::pi_pow_e)(eve::as(wxf)) << std::endl - << "-> downward(pi_pow_e)(as()) = " << eve::downward(eve::pi_pow_e)(eve::as()) << std::endl - << "-> downward(pi_pow_e)(as(wxf)) = " << eve::downward(eve::pi_pow_e)(eve::as(wxf)) << std::endl + << "-> pi_pow_e[upward](as()) = " << eve::pi_pow_e[eve::upward](eve::as()) << std::endl + << "-> pi_pow_e[upward](as(wxf)) = " << eve::pi_pow_e[eve::upward](eve::as(wxf)) << std::endl + << "-> pi_pow_e[downward](as()) = " << eve::pi_pow_e[eve::downward](eve::as()) << std::endl + << "-> pi_pow_e[downward](as(wxf)) = " << eve::pi_pow_e[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pi_pow_e(as()) = " << eve::pi_pow_e(eve::as()) << std::endl << "-> pi_pow_e(as(wxd)) = " << eve::pi_pow_e(eve::as(wxd)) << std::endl - << "-> upward(pi_pow_e)(as()) = " << eve::upward(eve::pi_pow_e)(eve::as()) << std::endl - << "-> upward(pi_pow_e)(as(wxd)) = " << eve::upward(eve::pi_pow_e)(eve::as(wxd)) << std::endl - << "-> downward(pi_pow_e)(as()) = " << eve::downward(eve::pi_pow_e)(eve::as()) << std::endl - << "-> downward(pi_pow_e)(as(wxd)) = " << eve::downward(eve::pi_pow_e)(eve::as(wxd)) << std::endl; + << "-> pi_pow_e[upward](as()) = " << eve::pi_pow_e[eve::upward](eve::as()) << std::endl + << "-> pi_pow_e[upward](as(wxd)) = " << eve::pi_pow_e[eve::upward](eve::as(wxd)) << std::endl + << "-> pi_pow_e[downward](as()) = " << eve::pi_pow_e[eve::downward](eve::as()) << std::endl + << "-> pi_pow_e[downward](as(wxd)) = " << eve::pi_pow_e[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pio_3.cpp b/test/doc/math/regular/pio_3.cpp index a986dddd4e..71331d6df3 100644 --- a/test/doc/math/regular/pio_3.cpp +++ b/test/doc/math/regular/pio_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pio_3(as()) = " << eve::pio_3(eve::as()) << std::endl << "-> pio_3(as(wxf)) = " << eve::pio_3(eve::as(wxf)) << std::endl - << "-> upward(pio_3)(as()) = " << eve::upward(eve::pio_3)(eve::as()) << std::endl - << "-> upward(pio_3)(as(wxf)) = " << eve::upward(eve::pio_3)(eve::as(wxf)) << std::endl - << "-> downward(pio_3)(as()) = " << eve::downward(eve::pio_3)(eve::as()) << std::endl - << "-> downward(pio_3)(as(wxf)) = " << eve::downward(eve::pio_3)(eve::as(wxf)) << std::endl + << "-> pio_3[upward](as()) = " << eve::pio_3[eve::upward](eve::as()) << std::endl + << "-> pio_3[upward](as(wxf)) = " << eve::pio_3[eve::upward](eve::as(wxf)) << std::endl + << "-> pio_3[downward](as()) = " << eve::pio_3[eve::downward](eve::as()) << std::endl + << "-> pio_3[downward](as(wxf)) = " << eve::pio_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pio_3(as()) = " << eve::pio_3(eve::as()) << std::endl << "-> pio_3(as(wxd)) = " << eve::pio_3(eve::as(wxd)) << std::endl - << "-> upward(pio_3)(as()) = " << eve::upward(eve::pio_3)(eve::as()) << std::endl - << "-> upward(pio_3)(as(wxd)) = " << eve::upward(eve::pio_3)(eve::as(wxd)) << std::endl - << "-> downward(pio_3)(as()) = " << eve::downward(eve::pio_3)(eve::as()) << std::endl - << "-> downward(pio_3)(as(wxd)) = " << eve::downward(eve::pio_3)(eve::as(wxd)) << std::endl; + << "-> pio_3[upward](as()) = " << eve::pio_3[eve::upward](eve::as()) << std::endl + << "-> pio_3[upward](as(wxd)) = " << eve::pio_3[eve::upward](eve::as(wxd)) << std::endl + << "-> pio_3[downward](as()) = " << eve::pio_3[eve::downward](eve::as()) << std::endl + << "-> pio_3[downward](as(wxd)) = " << eve::pio_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/pio_6.cpp b/test/doc/math/regular/pio_6.cpp index 0e0e6a5b70..e7dc7414d0 100644 --- a/test/doc/math/regular/pio_6.cpp +++ b/test/doc/math/regular/pio_6.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> pio_6(as()) = " << eve::pio_6(eve::as()) << std::endl << "-> pio_6(as(wxf)) = " << eve::pio_6(eve::as(wxf)) << std::endl - << "-> upward(pio_6)(as()) = " << eve::upward(eve::pio_6)(eve::as()) << std::endl - << "-> upward(pio_6)(as(wxf)) = " << eve::upward(eve::pio_6)(eve::as(wxf)) << std::endl - << "-> downward(pio_6)(as()) = " << eve::downward(eve::pio_6)(eve::as()) << std::endl - << "-> downward(pio_6)(as(wxf)) = " << eve::downward(eve::pio_6)(eve::as(wxf)) << std::endl + << "-> pio_6[upward](as()) = " << eve::pio_6[eve::upward](eve::as()) << std::endl + << "-> pio_6[upward](as(wxf)) = " << eve::pio_6[eve::upward](eve::as(wxf)) << std::endl + << "-> pio_6[downward](as()) = " << eve::pio_6[eve::downward](eve::as()) << std::endl + << "-> pio_6[downward](as(wxf)) = " << eve::pio_6[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> pio_6(as()) = " << eve::pio_6(eve::as()) << std::endl << "-> pio_6(as(wxd)) = " << eve::pio_6(eve::as(wxd)) << std::endl - << "-> upward(pio_6)(as()) = " << eve::upward(eve::pio_6)(eve::as()) << std::endl - << "-> upward(pio_6)(as(wxd)) = " << eve::upward(eve::pio_6)(eve::as(wxd)) << std::endl - << "-> downward(pio_6)(as()) = " << eve::downward(eve::pio_6)(eve::as()) << std::endl - << "-> downward(pio_6)(as(wxd)) = " << eve::downward(eve::pio_6)(eve::as(wxd)) << std::endl; + << "-> pio_6[upward](as()) = " << eve::pio_6[eve::upward](eve::as()) << std::endl + << "-> pio_6[upward](as(wxd)) = " << eve::pio_6[eve::upward](eve::as(wxd)) << std::endl + << "-> pio_6[downward](as()) = " << eve::pio_6[eve::downward](eve::as()) << std::endl + << "-> pio_6[downward](as(wxd)) = " << eve::pio_6[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/quarter.cpp b/test/doc/math/regular/quarter.cpp index 41a8895df6..42f2df291e 100644 --- a/test/doc/math/regular/quarter.cpp +++ b/test/doc/math/regular/quarter.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> quarter(as()) = " << eve::quarter(eve::as()) << std::endl << "-> quarter(as(wxf)) = " << eve::quarter(eve::as(wxf)) << std::endl - << "-> upward(quarter)(as()) = " << eve::upward(eve::quarter)(eve::as()) << std::endl - << "-> upward(quarter)(as(wxf)) = " << eve::upward(eve::quarter)(eve::as(wxf)) << std::endl - << "-> downward(quarter)(as()) = " << eve::downward(eve::quarter)(eve::as()) << std::endl - << "-> downward(quarter)(as(wxf)) = " << eve::downward(eve::quarter)(eve::as(wxf)) << std::endl + << "-> quarter[upward](as()) = " << eve::quarter[eve::upward](eve::as()) << std::endl + << "-> quarter[upward](as(wxf)) = " << eve::quarter[eve::upward](eve::as(wxf)) << std::endl + << "-> quarter[downward](as()) = " << eve::quarter[eve::downward](eve::as()) << std::endl + << "-> quarter[downward](as(wxf)) = " << eve::quarter[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> quarter(as()) = " << eve::quarter(eve::as()) << std::endl << "-> quarter(as(wxd)) = " << eve::quarter(eve::as(wxd)) << std::endl - << "-> upward(quarter)(as()) = " << eve::upward(eve::quarter)(eve::as()) << std::endl - << "-> upward(quarter)(as(wxd)) = " << eve::upward(eve::quarter)(eve::as(wxd)) << std::endl - << "-> downward(quarter)(as()) = " << eve::downward(eve::quarter)(eve::as()) << std::endl - << "-> downward(quarter)(as(wxd)) = " << eve::downward(eve::quarter)(eve::as(wxd)) << std::endl; + << "-> quarter[upward](as()) = " << eve::quarter[eve::upward](eve::as()) << std::endl + << "-> quarter[upward](as(wxd)) = " << eve::quarter[eve::upward](eve::as(wxd)) << std::endl + << "-> quarter[downward](as()) = " << eve::quarter[eve::downward](eve::as()) << std::endl + << "-> quarter[downward](as(wxd)) = " << eve::quarter[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/rayleigh_kurtosis.cpp b/test/doc/math/regular/rayleigh_kurtosis.cpp deleted file mode 100644 index c20aef98b7..0000000000 --- a/test/doc/math/regular/rayleigh_kurtosis.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include - -using wide_ft = eve::wide; -using wide_dt = eve::wide; - -int main() -{ - wide_ft wxf; - wide_dt wxd; - - std::cout << "---- simd" << std::setprecision(9) << std::endl - << "-> rayleigh_kurtosis(as()) = " << eve::rayleigh_kurtosis(eve::as()) << std::endl - << "-> rayleigh_kurtosis(as(wxf)) = " << eve::rayleigh_kurtosis(eve::as(wxf)) << std::endl - << "-> upward(rayleigh_kurtosis)(as()) = " << eve::upward(eve::rayleigh_kurtosis)(eve::as()) << std::endl - << "-> upward(rayleigh_kurtosis)(as(wxf)) = " << eve::upward(eve::rayleigh_kurtosis)(eve::as(wxf)) << std::endl - << "-> downward(rayleigh_kurtosis)(as()) = " << eve::downward(eve::rayleigh_kurtosis)(eve::as()) << std::endl - << "-> downward(rayleigh_kurtosis)(as(wxf)) = " << eve::downward(eve::rayleigh_kurtosis)(eve::as(wxf)) << std::endl - << std::setprecision(17) - << "-> rayleigh_kurtosis(as()) = " << eve::rayleigh_kurtosis(eve::as()) << std::endl - << "-> rayleigh_kurtosis(as(wxd)) = " << eve::rayleigh_kurtosis(eve::as(wxd)) << std::endl - << "-> upward(rayleigh_kurtosis)(as()) = " << eve::upward(eve::rayleigh_kurtosis)(eve::as()) << std::endl - << "-> upward(rayleigh_kurtosis)(as(wxd)) = " << eve::upward(eve::rayleigh_kurtosis)(eve::as(wxd)) << std::endl - << "-> downward(rayleigh_kurtosis)(as()) = " << eve::downward(eve::rayleigh_kurtosis)(eve::as()) << std::endl - << "-> downward(rayleigh_kurtosis)(as(wxd)) = " << eve::downward(eve::rayleigh_kurtosis)(eve::as(wxd)) << std::endl; - - float xf; - double xd; - - std::cout << "---- scalar" << std::endl - << "-> rayleigh_kurtosis(as()) = " << eve::rayleigh_kurtosis(eve::as(float())) << std::endl - << "-> rayleigh_kurtosis(as rayleigh_kurtosis(as()) = " << eve::rayleigh_kurtosis(eve::as(double()))<< std::endl - << "-> rayleigh_kurtosis(as -#include -#include -#include - -using wide_ft = eve::wide; -using wide_dt = eve::wide; - -int main() -{ - wide_ft wxf; - wide_dt wxd; - - std::cout << "---- simd" << std::setprecision(9) << std::endl - << "-> rayleigh_kurtosis_excess(as()) = " << eve::rayleigh_kurtosis_excess(eve::as()) << std::endl - << "-> rayleigh_kurtosis_excess(as(wxf)) = " << eve::rayleigh_kurtosis_excess(eve::as(wxf)) << std::endl - << "-> upward(rayleigh_kurtosis_excess)(as()) = " << eve::upward(eve::rayleigh_kurtosis_excess)(eve::as()) << std::endl - << "-> upward(rayleigh_kurtosis_excess)(as(wxf)) = " << eve::upward(eve::rayleigh_kurtosis_excess)(eve::as(wxf)) << std::endl - << "-> downward(rayleigh_kurtosis_excess)(as()) = " << eve::downward(eve::rayleigh_kurtosis_excess)(eve::as()) << std::endl - << "-> downward(rayleigh_kurtosis_excess)(as(wxf)) = " << eve::downward(eve::rayleigh_kurtosis_excess)(eve::as(wxf)) << std::endl - << std::setprecision(17) - << "-> rayleigh_kurtosis_excess(as()) = " << eve::rayleigh_kurtosis_excess(eve::as()) << std::endl - << "-> rayleigh_kurtosis_excess(as(wxd)) = " << eve::rayleigh_kurtosis_excess(eve::as(wxd)) << std::endl - << "-> upward(rayleigh_kurtosis_excess)(as()) = " << eve::upward(eve::rayleigh_kurtosis_excess)(eve::as()) << std::endl - << "-> upward(rayleigh_kurtosis_excess)(as(wxd)) = " << eve::upward(eve::rayleigh_kurtosis_excess)(eve::as(wxd)) << std::endl - << "-> downward(rayleigh_kurtosis_excess)(as()) = " << eve::downward(eve::rayleigh_kurtosis_excess)(eve::as()) << std::endl - << "-> downward(rayleigh_kurtosis_excess)(as(wxd)) = " << eve::downward(eve::rayleigh_kurtosis_excess)(eve::as(wxd)) << std::endl; - - float xf; - double xd; - - std::cout << "---- scalar" << std::endl - << "-> rayleigh_kurtosis_excess(as()) = " << eve::rayleigh_kurtosis_excess(eve::as(float())) << std::endl - << "-> rayleigh_kurtosis_excess(as rayleigh_kurtosis_excess(as()) = " << eve::rayleigh_kurtosis_excess(eve::as(double()))<< std::endl - << "-> rayleigh_kurtosis_excess(as -#include -#include -#include - -using wide_ft = eve::wide; -using wide_dt = eve::wide; - -int main() -{ - wide_ft wxf; - wide_dt wxd; - - std::cout << "---- simd" << std::setprecision(9) << std::endl - << "-> rayleigh_skewness(as()) = " << eve::rayleigh_skewness(eve::as()) << std::endl - << "-> rayleigh_skewness(as(wxf)) = " << eve::rayleigh_skewness(eve::as(wxf)) << std::endl - << "-> upward(rayleigh_skewness)(as()) = " << eve::upward(eve::rayleigh_skewness)(eve::as()) << std::endl - << "-> upward(rayleigh_skewness)(as(wxf)) = " << eve::upward(eve::rayleigh_skewness)(eve::as(wxf)) << std::endl - << "-> downward(rayleigh_skewness)(as()) = " << eve::downward(eve::rayleigh_skewness)(eve::as()) << std::endl - << "-> downward(rayleigh_skewness)(as(wxf)) = " << eve::downward(eve::rayleigh_skewness)(eve::as(wxf)) << std::endl - << std::setprecision(17) - << "-> rayleigh_skewness(as()) = " << eve::rayleigh_skewness(eve::as()) << std::endl - << "-> rayleigh_skewness(as(wxd)) = " << eve::rayleigh_skewness(eve::as(wxd)) << std::endl - << "-> upward(rayleigh_skewness)(as()) = " << eve::upward(eve::rayleigh_skewness)(eve::as()) << std::endl - << "-> upward(rayleigh_skewness)(as(wxd)) = " << eve::upward(eve::rayleigh_skewness)(eve::as(wxd)) << std::endl - << "-> downward(rayleigh_skewness)(as()) = " << eve::downward(eve::rayleigh_skewness)(eve::as()) << std::endl - << "-> downward(rayleigh_skewness)(as(wxd)) = " << eve::downward(eve::rayleigh_skewness)(eve::as(wxd)) << std::endl; - - float xf; - double xd; - - std::cout << "---- scalar" << std::endl - << "-> rayleigh_skewness(as()) = " << eve::rayleigh_skewness(eve::as(float())) << std::endl - << "-> rayleigh_skewness(as rayleigh_skewness(as()) = " << eve::rayleigh_skewness(eve::as(double()))<< std::endl - << "-> rayleigh_skewness(as rsqrt_2pi(as()) = " << eve::rsqrt_2pi(eve::as()) << std::endl << "-> rsqrt_2pi(as(wxf)) = " << eve::rsqrt_2pi(eve::as(wxf)) << std::endl - << "-> upward(rsqrt_2pi)(as()) = " << eve::upward(eve::rsqrt_2pi)(eve::as()) << std::endl - << "-> upward(rsqrt_2pi)(as(wxf)) = " << eve::upward(eve::rsqrt_2pi)(eve::as(wxf)) << std::endl - << "-> downward(rsqrt_2pi)(as()) = " << eve::downward(eve::rsqrt_2pi)(eve::as()) << std::endl - << "-> downward(rsqrt_2pi)(as(wxf)) = " << eve::downward(eve::rsqrt_2pi)(eve::as(wxf)) << std::endl + << "-> rsqrt_2pi[upward](as()) = " << eve::rsqrt_2pi[eve::upward](eve::as()) << std::endl + << "-> rsqrt_2pi[upward](as(wxf)) = " << eve::rsqrt_2pi[eve::upward](eve::as(wxf)) << std::endl + << "-> rsqrt_2pi[downward](as()) = " << eve::rsqrt_2pi[eve::downward](eve::as()) << std::endl + << "-> rsqrt_2pi[downward](as(wxf)) = " << eve::rsqrt_2pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> rsqrt_2pi(as()) = " << eve::rsqrt_2pi(eve::as()) << std::endl << "-> rsqrt_2pi(as(wxd)) = " << eve::rsqrt_2pi(eve::as(wxd)) << std::endl - << "-> upward(rsqrt_2pi)(as()) = " << eve::upward(eve::rsqrt_2pi)(eve::as()) << std::endl - << "-> upward(rsqrt_2pi)(as(wxd)) = " << eve::upward(eve::rsqrt_2pi)(eve::as(wxd)) << std::endl - << "-> downward(rsqrt_2pi)(as()) = " << eve::downward(eve::rsqrt_2pi)(eve::as()) << std::endl - << "-> downward(rsqrt_2pi)(as(wxd)) = " << eve::downward(eve::rsqrt_2pi)(eve::as(wxd)) << std::endl; + << "-> rsqrt_2pi[upward](as()) = " << eve::rsqrt_2pi[eve::upward](eve::as()) << std::endl + << "-> rsqrt_2pi[upward](as(wxd)) = " << eve::rsqrt_2pi[eve::upward](eve::as(wxd)) << std::endl + << "-> rsqrt_2pi[downward](as()) = " << eve::rsqrt_2pi[eve::downward](eve::as()) << std::endl + << "-> rsqrt_2pi[downward](as(wxd)) = " << eve::rsqrt_2pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/rsqrt_e.cpp b/test/doc/math/regular/rsqrt_e.cpp index 1d119ad21a..638a0faa33 100644 --- a/test/doc/math/regular/rsqrt_e.cpp +++ b/test/doc/math/regular/rsqrt_e.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> rsqrt_e(as()) = " << eve::rsqrt_e(eve::as()) << std::endl << "-> rsqrt_e(as(wxf)) = " << eve::rsqrt_e(eve::as(wxf)) << std::endl - << "-> upward(rsqrt_e)(as()) = " << eve::upward(eve::rsqrt_e)(eve::as()) << std::endl - << "-> upward(rsqrt_e)(as(wxf)) = " << eve::upward(eve::rsqrt_e)(eve::as(wxf)) << std::endl - << "-> downward(rsqrt_e)(as()) = " << eve::downward(eve::rsqrt_e)(eve::as()) << std::endl - << "-> downward(rsqrt_e)(as(wxf)) = " << eve::downward(eve::rsqrt_e)(eve::as(wxf)) << std::endl + << "-> rsqrt_e[upward](as()) = " << eve::rsqrt_e[eve::upward](eve::as()) << std::endl + << "-> rsqrt_e[upward](as(wxf)) = " << eve::rsqrt_e[eve::upward](eve::as(wxf)) << std::endl + << "-> rsqrt_e[downward](as()) = " << eve::rsqrt_e[eve::downward](eve::as()) << std::endl + << "-> rsqrt_e[downward](as(wxf)) = " << eve::rsqrt_e[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> rsqrt_e(as()) = " << eve::rsqrt_e(eve::as()) << std::endl << "-> rsqrt_e(as(wxd)) = " << eve::rsqrt_e(eve::as(wxd)) << std::endl - << "-> upward(rsqrt_e)(as()) = " << eve::upward(eve::rsqrt_e)(eve::as()) << std::endl - << "-> upward(rsqrt_e)(as(wxd)) = " << eve::upward(eve::rsqrt_e)(eve::as(wxd)) << std::endl - << "-> downward(rsqrt_e)(as()) = " << eve::downward(eve::rsqrt_e)(eve::as()) << std::endl - << "-> downward(rsqrt_e)(as(wxd)) = " << eve::downward(eve::rsqrt_e)(eve::as(wxd)) << std::endl; + << "-> rsqrt_e[upward](as()) = " << eve::rsqrt_e[eve::upward](eve::as()) << std::endl + << "-> rsqrt_e[upward](as(wxd)) = " << eve::rsqrt_e[eve::upward](eve::as(wxd)) << std::endl + << "-> rsqrt_e[downward](as()) = " << eve::rsqrt_e[eve::downward](eve::as()) << std::endl + << "-> rsqrt_e[downward](as(wxd)) = " << eve::rsqrt_e[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sin_1.cpp b/test/doc/math/regular/sin_1.cpp index 451685fadf..a2152a91ce 100644 --- a/test/doc/math/regular/sin_1.cpp +++ b/test/doc/math/regular/sin_1.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sin_1(as()) = " << eve::sin_1(eve::as()) << std::endl << "-> sin_1(as(wxf)) = " << eve::sin_1(eve::as(wxf)) << std::endl - << "-> upward(sin_1)(as()) = " << eve::upward(eve::sin_1)(eve::as()) << std::endl - << "-> upward(sin_1)(as(wxf)) = " << eve::upward(eve::sin_1)(eve::as(wxf)) << std::endl - << "-> downward(sin_1)(as()) = " << eve::downward(eve::sin_1)(eve::as()) << std::endl - << "-> downward(sin_1)(as(wxf)) = " << eve::downward(eve::sin_1)(eve::as(wxf)) << std::endl + << "-> sin_1[upward](as()) = " << eve::sin_1[eve::upward](eve::as()) << std::endl + << "-> sin_1[upward](as(wxf)) = " << eve::sin_1[eve::upward](eve::as(wxf)) << std::endl + << "-> sin_1[downward](as()) = " << eve::sin_1[eve::downward](eve::as()) << std::endl + << "-> sin_1[downward](as(wxf)) = " << eve::sin_1[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sin_1(as()) = " << eve::sin_1(eve::as()) << std::endl << "-> sin_1(as(wxd)) = " << eve::sin_1(eve::as(wxd)) << std::endl - << "-> upward(sin_1)(as()) = " << eve::upward(eve::sin_1)(eve::as()) << std::endl - << "-> upward(sin_1)(as(wxd)) = " << eve::upward(eve::sin_1)(eve::as(wxd)) << std::endl - << "-> downward(sin_1)(as()) = " << eve::downward(eve::sin_1)(eve::as()) << std::endl - << "-> downward(sin_1)(as(wxd)) = " << eve::downward(eve::sin_1)(eve::as(wxd)) << std::endl; + << "-> sin_1[upward](as()) = " << eve::sin_1[eve::upward](eve::as()) << std::endl + << "-> sin_1[upward](as(wxd)) = " << eve::sin_1[eve::upward](eve::as(wxd)) << std::endl + << "-> sin_1[downward](as()) = " << eve::sin_1[eve::downward](eve::as()) << std::endl + << "-> sin_1[downward](as(wxd)) = " << eve::sin_1[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sinh_1.cpp b/test/doc/math/regular/sinh_1.cpp index cc1929cda9..150bb651e9 100644 --- a/test/doc/math/regular/sinh_1.cpp +++ b/test/doc/math/regular/sinh_1.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sinh_1(as()) = " << eve::sinh_1(eve::as()) << std::endl << "-> sinh_1(as(wxf)) = " << eve::sinh_1(eve::as(wxf)) << std::endl - << "-> upward(sinh_1)(as()) = " << eve::upward(eve::sinh_1)(eve::as()) << std::endl - << "-> upward(sinh_1)(as(wxf)) = " << eve::upward(eve::sinh_1)(eve::as(wxf)) << std::endl - << "-> downward(sinh_1)(as()) = " << eve::downward(eve::sinh_1)(eve::as()) << std::endl - << "-> downward(sinh_1)(as(wxf)) = " << eve::downward(eve::sinh_1)(eve::as(wxf)) << std::endl + << "-> sinh_1[upward](as()) = " << eve::sinh_1[eve::upward](eve::as()) << std::endl + << "-> sinh_1[upward](as(wxf)) = " << eve::sinh_1[eve::upward](eve::as(wxf)) << std::endl + << "-> sinh_1[downward](as()) = " << eve::sinh_1[eve::downward](eve::as()) << std::endl + << "-> sinh_1[downward](as(wxf)) = " << eve::sinh_1[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sinh_1(as()) = " << eve::sinh_1(eve::as()) << std::endl << "-> sinh_1(as(wxd)) = " << eve::sinh_1(eve::as(wxd)) << std::endl - << "-> upward(sinh_1)(as()) = " << eve::upward(eve::sinh_1)(eve::as()) << std::endl - << "-> upward(sinh_1)(as(wxd)) = " << eve::upward(eve::sinh_1)(eve::as(wxd)) << std::endl - << "-> downward(sinh_1)(as()) = " << eve::downward(eve::sinh_1)(eve::as()) << std::endl - << "-> downward(sinh_1)(as(wxd)) = " << eve::downward(eve::sinh_1)(eve::as(wxd)) << std::endl; + << "-> sinh_1[upward](as()) = " << eve::sinh_1[eve::upward](eve::as()) << std::endl + << "-> sinh_1[upward](as(wxd)) = " << eve::sinh_1[eve::upward](eve::as(wxd)) << std::endl + << "-> sinh_1[downward](as()) = " << eve::sinh_1[eve::downward](eve::as()) << std::endl + << "-> sinh_1[downward](as(wxd)) = " << eve::sinh_1[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sixth.cpp b/test/doc/math/regular/sixth.cpp index 07ac1423ef..132d0c5b18 100644 --- a/test/doc/math/regular/sixth.cpp +++ b/test/doc/math/regular/sixth.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sixth(as()) = " << eve::sixth(eve::as()) << std::endl << "-> sixth(as(wxf)) = " << eve::sixth(eve::as(wxf)) << std::endl - << "-> upward(sixth)(as()) = " << eve::upward(eve::sixth)(eve::as()) << std::endl - << "-> upward(sixth)(as(wxf)) = " << eve::upward(eve::sixth)(eve::as(wxf)) << std::endl - << "-> downward(sixth)(as()) = " << eve::downward(eve::sixth)(eve::as()) << std::endl - << "-> downward(sixth)(as(wxf)) = " << eve::downward(eve::sixth)(eve::as(wxf)) << std::endl + << "-> sixth[upward](as()) = " << eve::sixth[eve::upward](eve::as()) << std::endl + << "-> sixth[upward](as(wxf)) = " << eve::sixth[eve::upward](eve::as(wxf)) << std::endl + << "-> sixth[downward](as()) = " << eve::sixth[eve::downward](eve::as()) << std::endl + << "-> sixth[downward](as(wxf)) = " << eve::sixth[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sixth(as()) = " << eve::sixth(eve::as()) << std::endl << "-> sixth(as(wxd)) = " << eve::sixth(eve::as(wxd)) << std::endl - << "-> upward(sixth)(as()) = " << eve::upward(eve::sixth)(eve::as()) << std::endl - << "-> upward(sixth)(as(wxd)) = " << eve::upward(eve::sixth)(eve::as(wxd)) << std::endl - << "-> downward(sixth)(as()) = " << eve::downward(eve::sixth)(eve::as()) << std::endl - << "-> downward(sixth)(as(wxd)) = " << eve::downward(eve::sixth)(eve::as(wxd)) << std::endl; + << "-> sixth[upward](as()) = " << eve::sixth[eve::upward](eve::as()) << std::endl + << "-> sixth[upward](as(wxd)) = " << eve::sixth[eve::upward](eve::as(wxd)) << std::endl + << "-> sixth[downward](as()) = " << eve::sixth[eve::downward](eve::as()) << std::endl + << "-> sixth[downward](as(wxd)) = " << eve::sixth[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_2.cpp b/test/doc/math/regular/sqrt_2.cpp index 1d9f0987df..9f00aaa1e6 100644 --- a/test/doc/math/regular/sqrt_2.cpp +++ b/test/doc/math/regular/sqrt_2.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_2(as()) = " << eve::sqrt_2(eve::as()) << std::endl << "-> sqrt_2(as(wxf)) = " << eve::sqrt_2(eve::as(wxf)) << std::endl - << "-> upward(sqrt_2)(as()) = " << eve::upward(eve::sqrt_2)(eve::as()) << std::endl - << "-> upward(sqrt_2)(as(wxf)) = " << eve::upward(eve::sqrt_2)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_2)(as()) = " << eve::downward(eve::sqrt_2)(eve::as()) << std::endl - << "-> downward(sqrt_2)(as(wxf)) = " << eve::downward(eve::sqrt_2)(eve::as(wxf)) << std::endl + << "-> sqrt_2[upward](as()) = " << eve::sqrt_2[eve::upward](eve::as()) << std::endl + << "-> sqrt_2[upward](as(wxf)) = " << eve::sqrt_2[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_2[downward](as()) = " << eve::sqrt_2[eve::downward](eve::as()) << std::endl + << "-> sqrt_2[downward](as(wxf)) = " << eve::sqrt_2[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_2(as()) = " << eve::sqrt_2(eve::as()) << std::endl << "-> sqrt_2(as(wxd)) = " << eve::sqrt_2(eve::as(wxd)) << std::endl - << "-> upward(sqrt_2)(as()) = " << eve::upward(eve::sqrt_2)(eve::as()) << std::endl - << "-> upward(sqrt_2)(as(wxd)) = " << eve::upward(eve::sqrt_2)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_2)(as()) = " << eve::downward(eve::sqrt_2)(eve::as()) << std::endl - << "-> downward(sqrt_2)(as(wxd)) = " << eve::downward(eve::sqrt_2)(eve::as(wxd)) << std::endl; + << "-> sqrt_2[upward](as()) = " << eve::sqrt_2[eve::upward](eve::as()) << std::endl + << "-> sqrt_2[upward](as(wxd)) = " << eve::sqrt_2[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_2[downward](as()) = " << eve::sqrt_2[eve::downward](eve::as()) << std::endl + << "-> sqrt_2[downward](as(wxd)) = " << eve::sqrt_2[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_2pi.cpp b/test/doc/math/regular/sqrt_2pi.cpp index f2688408af..260e97274c 100644 --- a/test/doc/math/regular/sqrt_2pi.cpp +++ b/test/doc/math/regular/sqrt_2pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_2pi(as()) = " << eve::sqrt_2pi(eve::as()) << std::endl << "-> sqrt_2pi(as(wxf)) = " << eve::sqrt_2pi(eve::as(wxf)) << std::endl - << "-> upward(sqrt_2pi)(as()) = " << eve::upward(eve::sqrt_2pi)(eve::as()) << std::endl - << "-> upward(sqrt_2pi)(as(wxf)) = " << eve::upward(eve::sqrt_2pi)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_2pi)(as()) = " << eve::downward(eve::sqrt_2pi)(eve::as()) << std::endl - << "-> downward(sqrt_2pi)(as(wxf)) = " << eve::downward(eve::sqrt_2pi)(eve::as(wxf)) << std::endl + << "-> sqrt_2pi[upward](as()) = " << eve::sqrt_2pi[eve::upward](eve::as()) << std::endl + << "-> sqrt_2pi[upward](as(wxf)) = " << eve::sqrt_2pi[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_2pi[downward](as()) = " << eve::sqrt_2pi[eve::downward](eve::as()) << std::endl + << "-> sqrt_2pi[downward](as(wxf)) = " << eve::sqrt_2pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_2pi(as()) = " << eve::sqrt_2pi(eve::as()) << std::endl << "-> sqrt_2pi(as(wxd)) = " << eve::sqrt_2pi(eve::as(wxd)) << std::endl - << "-> upward(sqrt_2pi)(as()) = " << eve::upward(eve::sqrt_2pi)(eve::as()) << std::endl - << "-> upward(sqrt_2pi)(as(wxd)) = " << eve::upward(eve::sqrt_2pi)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_2pi)(as()) = " << eve::downward(eve::sqrt_2pi)(eve::as()) << std::endl - << "-> downward(sqrt_2pi)(as(wxd)) = " << eve::downward(eve::sqrt_2pi)(eve::as(wxd)) << std::endl; + << "-> sqrt_2pi[upward](as()) = " << eve::sqrt_2pi[eve::upward](eve::as()) << std::endl + << "-> sqrt_2pi[upward](as(wxd)) = " << eve::sqrt_2pi[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_2pi[downward](as()) = " << eve::sqrt_2pi[eve::downward](eve::as()) << std::endl + << "-> sqrt_2pi[downward](as(wxd)) = " << eve::sqrt_2pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_3.cpp b/test/doc/math/regular/sqrt_3.cpp index 6d28051ac8..ed31255b9a 100644 --- a/test/doc/math/regular/sqrt_3.cpp +++ b/test/doc/math/regular/sqrt_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_3(as()) = " << eve::sqrt_3(eve::as()) << std::endl << "-> sqrt_3(as(wxf)) = " << eve::sqrt_3(eve::as(wxf)) << std::endl - << "-> upward(sqrt_3)(as()) = " << eve::upward(eve::sqrt_3)(eve::as()) << std::endl - << "-> upward(sqrt_3)(as(wxf)) = " << eve::upward(eve::sqrt_3)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_3)(as()) = " << eve::downward(eve::sqrt_3)(eve::as()) << std::endl - << "-> downward(sqrt_3)(as(wxf)) = " << eve::downward(eve::sqrt_3)(eve::as(wxf)) << std::endl + << "-> sqrt_3[upward](as()) = " << eve::sqrt_3[eve::upward](eve::as()) << std::endl + << "-> sqrt_3[upward](as(wxf)) = " << eve::sqrt_3[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_3[downward](as()) = " << eve::sqrt_3[eve::downward](eve::as()) << std::endl + << "-> sqrt_3[downward](as(wxf)) = " << eve::sqrt_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_3(as()) = " << eve::sqrt_3(eve::as()) << std::endl << "-> sqrt_3(as(wxd)) = " << eve::sqrt_3(eve::as(wxd)) << std::endl - << "-> upward(sqrt_3)(as()) = " << eve::upward(eve::sqrt_3)(eve::as()) << std::endl - << "-> upward(sqrt_3)(as(wxd)) = " << eve::upward(eve::sqrt_3)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_3)(as()) = " << eve::downward(eve::sqrt_3)(eve::as()) << std::endl - << "-> downward(sqrt_3)(as(wxd)) = " << eve::downward(eve::sqrt_3)(eve::as(wxd)) << std::endl; + << "-> sqrt_3[upward](as()) = " << eve::sqrt_3[eve::upward](eve::as()) << std::endl + << "-> sqrt_3[upward](as(wxd)) = " << eve::sqrt_3[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_3[downward](as()) = " << eve::sqrt_3[eve::downward](eve::as()) << std::endl + << "-> sqrt_3[downward](as(wxd)) = " << eve::sqrt_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_e.cpp b/test/doc/math/regular/sqrt_e.cpp index 6940ae3741..b751712bc8 100644 --- a/test/doc/math/regular/sqrt_e.cpp +++ b/test/doc/math/regular/sqrt_e.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_e(as()) = " << eve::sqrt_e(eve::as()) << std::endl << "-> sqrt_e(as(wxf)) = " << eve::sqrt_e(eve::as(wxf)) << std::endl - << "-> upward(sqrt_e)(as()) = " << eve::upward(eve::sqrt_e)(eve::as()) << std::endl - << "-> upward(sqrt_e)(as(wxf)) = " << eve::upward(eve::sqrt_e)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_e)(as()) = " << eve::downward(eve::sqrt_e)(eve::as()) << std::endl - << "-> downward(sqrt_e)(as(wxf)) = " << eve::downward(eve::sqrt_e)(eve::as(wxf)) << std::endl + << "-> sqrt_e[upward](as()) = " << eve::sqrt_e[eve::upward](eve::as()) << std::endl + << "-> sqrt_e[upward](as(wxf)) = " << eve::sqrt_e[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_e[downward](as()) = " << eve::sqrt_e[eve::downward](eve::as()) << std::endl + << "-> sqrt_e[downward](as(wxf)) = " << eve::sqrt_e[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_e(as()) = " << eve::sqrt_e(eve::as()) << std::endl << "-> sqrt_e(as(wxd)) = " << eve::sqrt_e(eve::as(wxd)) << std::endl - << "-> upward(sqrt_e)(as()) = " << eve::upward(eve::sqrt_e)(eve::as()) << std::endl - << "-> upward(sqrt_e)(as(wxd)) = " << eve::upward(eve::sqrt_e)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_e)(as()) = " << eve::downward(eve::sqrt_e)(eve::as()) << std::endl - << "-> downward(sqrt_e)(as(wxd)) = " << eve::downward(eve::sqrt_e)(eve::as(wxd)) << std::endl; + << "-> sqrt_e[upward](as()) = " << eve::sqrt_e[eve::upward](eve::as()) << std::endl + << "-> sqrt_e[upward](as(wxd)) = " << eve::sqrt_e[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_e[downward](as()) = " << eve::sqrt_e[eve::downward](eve::as()) << std::endl + << "-> sqrt_e[downward](as(wxd)) = " << eve::sqrt_e[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_pi.cpp b/test/doc/math/regular/sqrt_pi.cpp index 86d9561978..b8598e189c 100644 --- a/test/doc/math/regular/sqrt_pi.cpp +++ b/test/doc/math/regular/sqrt_pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_pi(as()) = " << eve::sqrt_pi(eve::as()) << std::endl << "-> sqrt_pi(as(wxf)) = " << eve::sqrt_pi(eve::as(wxf)) << std::endl - << "-> upward(sqrt_pi)(as()) = " << eve::upward(eve::sqrt_pi)(eve::as()) << std::endl - << "-> upward(sqrt_pi)(as(wxf)) = " << eve::upward(eve::sqrt_pi)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_pi)(as()) = " << eve::downward(eve::sqrt_pi)(eve::as()) << std::endl - << "-> downward(sqrt_pi)(as(wxf)) = " << eve::downward(eve::sqrt_pi)(eve::as(wxf)) << std::endl + << "-> sqrt_pi[upward](as()) = " << eve::sqrt_pi[eve::upward](eve::as()) << std::endl + << "-> sqrt_pi[upward](as(wxf)) = " << eve::sqrt_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_pi[downward](as()) = " << eve::sqrt_pi[eve::downward](eve::as()) << std::endl + << "-> sqrt_pi[downward](as(wxf)) = " << eve::sqrt_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_pi(as()) = " << eve::sqrt_pi(eve::as()) << std::endl << "-> sqrt_pi(as(wxd)) = " << eve::sqrt_pi(eve::as(wxd)) << std::endl - << "-> upward(sqrt_pi)(as()) = " << eve::upward(eve::sqrt_pi)(eve::as()) << std::endl - << "-> upward(sqrt_pi)(as(wxd)) = " << eve::upward(eve::sqrt_pi)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_pi)(as()) = " << eve::downward(eve::sqrt_pi)(eve::as()) << std::endl - << "-> downward(sqrt_pi)(as(wxd)) = " << eve::downward(eve::sqrt_pi)(eve::as(wxd)) << std::endl; + << "-> sqrt_pi[upward](as()) = " << eve::sqrt_pi[eve::upward](eve::as()) << std::endl + << "-> sqrt_pi[upward](as(wxd)) = " << eve::sqrt_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_pi[downward](as()) = " << eve::sqrt_pi[eve::downward](eve::as()) << std::endl + << "-> sqrt_pi[downward](as(wxd)) = " << eve::sqrt_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrt_pio_2.cpp b/test/doc/math/regular/sqrt_pio_2.cpp index f7a745edbd..0445aaa0fa 100644 --- a/test/doc/math/regular/sqrt_pio_2.cpp +++ b/test/doc/math/regular/sqrt_pio_2.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrt_pio_2(as()) = " << eve::sqrt_pio_2(eve::as()) << std::endl << "-> sqrt_pio_2(as(wxf)) = " << eve::sqrt_pio_2(eve::as(wxf)) << std::endl - << "-> upward(sqrt_pio_2)(as()) = " << eve::upward(eve::sqrt_pio_2)(eve::as()) << std::endl - << "-> upward(sqrt_pio_2)(as(wxf)) = " << eve::upward(eve::sqrt_pio_2)(eve::as(wxf)) << std::endl - << "-> downward(sqrt_pio_2)(as()) = " << eve::downward(eve::sqrt_pio_2)(eve::as()) << std::endl - << "-> downward(sqrt_pio_2)(as(wxf)) = " << eve::downward(eve::sqrt_pio_2)(eve::as(wxf)) << std::endl + << "-> sqrt_pio_2[upward](as()) = " << eve::sqrt_pio_2[eve::upward](eve::as()) << std::endl + << "-> sqrt_pio_2[upward](as(wxf)) = " << eve::sqrt_pio_2[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrt_pio_2[downward](as()) = " << eve::sqrt_pio_2[eve::downward](eve::as()) << std::endl + << "-> sqrt_pio_2[downward](as(wxf)) = " << eve::sqrt_pio_2[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrt_pio_2(as()) = " << eve::sqrt_pio_2(eve::as()) << std::endl << "-> sqrt_pio_2(as(wxd)) = " << eve::sqrt_pio_2(eve::as(wxd)) << std::endl - << "-> upward(sqrt_pio_2)(as()) = " << eve::upward(eve::sqrt_pio_2)(eve::as()) << std::endl - << "-> upward(sqrt_pio_2)(as(wxd)) = " << eve::upward(eve::sqrt_pio_2)(eve::as(wxd)) << std::endl - << "-> downward(sqrt_pio_2)(as()) = " << eve::downward(eve::sqrt_pio_2)(eve::as()) << std::endl - << "-> downward(sqrt_pio_2)(as(wxd)) = " << eve::downward(eve::sqrt_pio_2)(eve::as(wxd)) << std::endl; + << "-> sqrt_pio_2[upward](as()) = " << eve::sqrt_pio_2[eve::upward](eve::as()) << std::endl + << "-> sqrt_pio_2[upward](as(wxd)) = " << eve::sqrt_pio_2[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrt_pio_2[downward](as()) = " << eve::sqrt_pio_2[eve::downward](eve::as()) << std::endl + << "-> sqrt_pio_2[downward](as(wxd)) = " << eve::sqrt_pio_2[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/sqrtlog_4.cpp b/test/doc/math/regular/sqrtlog_4.cpp index d8a352f442..1221e9b826 100644 --- a/test/doc/math/regular/sqrtlog_4.cpp +++ b/test/doc/math/regular/sqrtlog_4.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> sqrtlog_4(as()) = " << eve::sqrtlog_4(eve::as()) << std::endl << "-> sqrtlog_4(as(wxf)) = " << eve::sqrtlog_4(eve::as(wxf)) << std::endl - << "-> upward(sqrtlog_4)(as()) = " << eve::upward(eve::sqrtlog_4)(eve::as()) << std::endl - << "-> upward(sqrtlog_4)(as(wxf)) = " << eve::upward(eve::sqrtlog_4)(eve::as(wxf)) << std::endl - << "-> downward(sqrtlog_4)(as()) = " << eve::downward(eve::sqrtlog_4)(eve::as()) << std::endl - << "-> downward(sqrtlog_4)(as(wxf)) = " << eve::downward(eve::sqrtlog_4)(eve::as(wxf)) << std::endl + << "-> sqrtlog_4[upward](as()) = " << eve::sqrtlog_4[eve::upward](eve::as()) << std::endl + << "-> sqrtlog_4[upward](as(wxf)) = " << eve::sqrtlog_4[eve::upward](eve::as(wxf)) << std::endl + << "-> sqrtlog_4[downward](as()) = " << eve::sqrtlog_4[eve::downward](eve::as()) << std::endl + << "-> sqrtlog_4[downward](as(wxf)) = " << eve::sqrtlog_4[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> sqrtlog_4(as()) = " << eve::sqrtlog_4(eve::as()) << std::endl << "-> sqrtlog_4(as(wxd)) = " << eve::sqrtlog_4(eve::as(wxd)) << std::endl - << "-> upward(sqrtlog_4)(as()) = " << eve::upward(eve::sqrtlog_4)(eve::as()) << std::endl - << "-> upward(sqrtlog_4)(as(wxd)) = " << eve::upward(eve::sqrtlog_4)(eve::as(wxd)) << std::endl - << "-> downward(sqrtlog_4)(as()) = " << eve::downward(eve::sqrtlog_4)(eve::as()) << std::endl - << "-> downward(sqrtlog_4)(as(wxd)) = " << eve::downward(eve::sqrtlog_4)(eve::as(wxd)) << std::endl; + << "-> sqrtlog_4[upward](as()) = " << eve::sqrtlog_4[eve::upward](eve::as()) << std::endl + << "-> sqrtlog_4[upward](as(wxd)) = " << eve::sqrtlog_4[eve::upward](eve::as(wxd)) << std::endl + << "-> sqrtlog_4[downward](as()) = " << eve::sqrtlog_4[eve::downward](eve::as()) << std::endl + << "-> sqrtlog_4[downward](as(wxd)) = " << eve::sqrtlog_4[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/third.cpp b/test/doc/math/regular/third.cpp index 2bf6c943f3..a6c31417d4 100644 --- a/test/doc/math/regular/third.cpp +++ b/test/doc/math/regular/third.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> third(as()) = " << eve::third(eve::as()) << std::endl << "-> third(as(wxf)) = " << eve::third(eve::as(wxf)) << std::endl - << "-> upward(third)(as()) = " << eve::upward(eve::third)(eve::as()) << std::endl - << "-> upward(third)(as(wxf)) = " << eve::upward(eve::third)(eve::as(wxf)) << std::endl - << "-> downward(third)(as()) = " << eve::downward(eve::third)(eve::as()) << std::endl - << "-> downward(third)(as(wxf)) = " << eve::downward(eve::third)(eve::as(wxf)) << std::endl + << "-> third[upward](as()) = " << eve::third[eve::upward](eve::as()) << std::endl + << "-> third[upward](as(wxf)) = " << eve::third[eve::upward](eve::as(wxf)) << std::endl + << "-> third[downward](as()) = " << eve::third[eve::downward](eve::as()) << std::endl + << "-> third[downward](as(wxf)) = " << eve::third[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> third(as()) = " << eve::third(eve::as()) << std::endl << "-> third(as(wxd)) = " << eve::third(eve::as(wxd)) << std::endl - << "-> upward(third)(as()) = " << eve::upward(eve::third)(eve::as()) << std::endl - << "-> upward(third)(as(wxd)) = " << eve::upward(eve::third)(eve::as(wxd)) << std::endl - << "-> downward(third)(as()) = " << eve::downward(eve::third)(eve::as()) << std::endl - << "-> downward(third)(as(wxd)) = " << eve::downward(eve::third)(eve::as(wxd)) << std::endl; + << "-> third[upward](as()) = " << eve::third[eve::upward](eve::as()) << std::endl + << "-> third[upward](as(wxd)) = " << eve::third[eve::upward](eve::as(wxd)) << std::endl + << "-> third[downward](as()) = " << eve::third[eve::downward](eve::as()) << std::endl + << "-> third[downward](as(wxd)) = " << eve::third[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/three_o_4.cpp b/test/doc/math/regular/three_o_4.cpp index e4d7069c50..330297d24b 100644 --- a/test/doc/math/regular/three_o_4.cpp +++ b/test/doc/math/regular/three_o_4.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> three_o_4(as()) = " << eve::three_o_4(eve::as()) << std::endl << "-> three_o_4(as(wxf)) = " << eve::three_o_4(eve::as(wxf)) << std::endl - << "-> upward(three_o_4)(as()) = " << eve::upward(eve::three_o_4)(eve::as()) << std::endl - << "-> upward(three_o_4)(as(wxf)) = " << eve::upward(eve::three_o_4)(eve::as(wxf)) << std::endl - << "-> downward(three_o_4)(as()) = " << eve::downward(eve::three_o_4)(eve::as()) << std::endl - << "-> downward(three_o_4)(as(wxf)) = " << eve::downward(eve::three_o_4)(eve::as(wxf)) << std::endl + << "-> three_o_4[upward](as()) = " << eve::three_o_4[eve::upward](eve::as()) << std::endl + << "-> three_o_4[upward](as(wxf)) = " << eve::three_o_4[eve::upward](eve::as(wxf)) << std::endl + << "-> three_o_4[downward](as()) = " << eve::three_o_4[eve::downward](eve::as()) << std::endl + << "-> three_o_4[downward](as(wxf)) = " << eve::three_o_4[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> three_o_4(as()) = " << eve::three_o_4(eve::as()) << std::endl << "-> three_o_4(as(wxd)) = " << eve::three_o_4(eve::as(wxd)) << std::endl - << "-> upward(three_o_4)(as()) = " << eve::upward(eve::three_o_4)(eve::as()) << std::endl - << "-> upward(three_o_4)(as(wxd)) = " << eve::upward(eve::three_o_4)(eve::as(wxd)) << std::endl - << "-> downward(three_o_4)(as()) = " << eve::downward(eve::three_o_4)(eve::as()) << std::endl - << "-> downward(three_o_4)(as(wxd)) = " << eve::downward(eve::three_o_4)(eve::as(wxd)) << std::endl; + << "-> three_o_4[upward](as()) = " << eve::three_o_4[eve::upward](eve::as()) << std::endl + << "-> three_o_4[upward](as(wxd)) = " << eve::three_o_4[eve::upward](eve::as(wxd)) << std::endl + << "-> three_o_4[downward](as()) = " << eve::three_o_4[eve::downward](eve::as()) << std::endl + << "-> three_o_4[downward](as(wxd)) = " << eve::three_o_4[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/three_pio_4.cpp b/test/doc/math/regular/three_pio_4.cpp index 3dd930dc4b..2c84159058 100644 --- a/test/doc/math/regular/three_pio_4.cpp +++ b/test/doc/math/regular/three_pio_4.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> three_pio_4(as()) = " << eve::three_pio_4(eve::as()) << std::endl << "-> three_pio_4(as(wxf)) = " << eve::three_pio_4(eve::as(wxf)) << std::endl - << "-> upward(three_pio_4)(as()) = " << eve::upward(eve::three_pio_4)(eve::as()) << std::endl - << "-> upward(three_pio_4)(as(wxf)) = " << eve::upward(eve::three_pio_4)(eve::as(wxf)) << std::endl - << "-> downward(three_pio_4)(as()) = " << eve::downward(eve::three_pio_4)(eve::as()) << std::endl - << "-> downward(three_pio_4)(as(wxf)) = " << eve::downward(eve::three_pio_4)(eve::as(wxf)) << std::endl + << "-> three_pio_4[upward](as()) = " << eve::three_pio_4[eve::upward](eve::as()) << std::endl + << "-> three_pio_4[upward](as(wxf)) = " << eve::three_pio_4[eve::upward](eve::as(wxf)) << std::endl + << "-> three_pio_4[downward](as()) = " << eve::three_pio_4[eve::downward](eve::as()) << std::endl + << "-> three_pio_4[downward](as(wxf)) = " << eve::three_pio_4[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> three_pio_4(as()) = " << eve::three_pio_4(eve::as()) << std::endl << "-> three_pio_4(as(wxd)) = " << eve::three_pio_4(eve::as(wxd)) << std::endl - << "-> upward(three_pio_4)(as()) = " << eve::upward(eve::three_pio_4)(eve::as()) << std::endl - << "-> upward(three_pio_4)(as(wxd)) = " << eve::upward(eve::three_pio_4)(eve::as(wxd)) << std::endl - << "-> downward(three_pio_4)(as()) = " << eve::downward(eve::three_pio_4)(eve::as()) << std::endl - << "-> downward(three_pio_4)(as(wxd)) = " << eve::downward(eve::three_pio_4)(eve::as(wxd)) << std::endl; + << "-> three_pio_4[upward](as()) = " << eve::three_pio_4[eve::upward](eve::as()) << std::endl + << "-> three_pio_4[upward](as(wxd)) = " << eve::three_pio_4[eve::upward](eve::as(wxd)) << std::endl + << "-> three_pio_4[downward](as()) = " << eve::three_pio_4[eve::downward](eve::as()) << std::endl + << "-> three_pio_4[downward](as(wxd)) = " << eve::three_pio_4[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/two_o_3.cpp b/test/doc/math/regular/two_o_3.cpp index d6bf30a92a..86590316aa 100644 --- a/test/doc/math/regular/two_o_3.cpp +++ b/test/doc/math/regular/two_o_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> two_o_3(as()) = " << eve::two_o_3(eve::as()) << std::endl << "-> two_o_3(as(wxf)) = " << eve::two_o_3(eve::as(wxf)) << std::endl - << "-> upward(two_o_3)(as()) = " << eve::upward(eve::two_o_3)(eve::as()) << std::endl - << "-> upward(two_o_3)(as(wxf)) = " << eve::upward(eve::two_o_3)(eve::as(wxf)) << std::endl - << "-> downward(two_o_3)(as()) = " << eve::downward(eve::two_o_3)(eve::as()) << std::endl - << "-> downward(two_o_3)(as(wxf)) = " << eve::downward(eve::two_o_3)(eve::as(wxf)) << std::endl + << "-> two_o_3[upward](as()) = " << eve::two_o_3[eve::upward](eve::as()) << std::endl + << "-> two_o_3[upward](as(wxf)) = " << eve::two_o_3[eve::upward](eve::as(wxf)) << std::endl + << "-> two_o_3[downward](as()) = " << eve::two_o_3[eve::downward](eve::as()) << std::endl + << "-> two_o_3[downward](as(wxf)) = " << eve::two_o_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> two_o_3(as()) = " << eve::two_o_3(eve::as()) << std::endl << "-> two_o_3(as(wxd)) = " << eve::two_o_3(eve::as(wxd)) << std::endl - << "-> upward(two_o_3)(as()) = " << eve::upward(eve::two_o_3)(eve::as()) << std::endl - << "-> upward(two_o_3)(as(wxd)) = " << eve::upward(eve::two_o_3)(eve::as(wxd)) << std::endl - << "-> downward(two_o_3)(as()) = " << eve::downward(eve::two_o_3)(eve::as()) << std::endl - << "-> downward(two_o_3)(as(wxd)) = " << eve::downward(eve::two_o_3)(eve::as(wxd)) << std::endl; + << "-> two_o_3[upward](as()) = " << eve::two_o_3[eve::upward](eve::as()) << std::endl + << "-> two_o_3[upward](as(wxd)) = " << eve::two_o_3[eve::upward](eve::as(wxd)) << std::endl + << "-> two_o_3[downward](as()) = " << eve::two_o_3[eve::downward](eve::as()) << std::endl + << "-> two_o_3[downward](as(wxd)) = " << eve::two_o_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/two_o_sqrt_pi.cpp b/test/doc/math/regular/two_o_sqrt_pi.cpp index cd4e8c88ef..2d31bebaf8 100644 --- a/test/doc/math/regular/two_o_sqrt_pi.cpp +++ b/test/doc/math/regular/two_o_sqrt_pi.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> two_o_sqrt_pi(as()) = " << eve::two_o_sqrt_pi(eve::as()) << std::endl << "-> two_o_sqrt_pi(as(wxf)) = " << eve::two_o_sqrt_pi(eve::as(wxf)) << std::endl - << "-> upward(two_o_sqrt_pi)(as()) = " << eve::upward(eve::two_o_sqrt_pi)(eve::as()) << std::endl - << "-> upward(two_o_sqrt_pi)(as(wxf)) = " << eve::upward(eve::two_o_sqrt_pi)(eve::as(wxf)) << std::endl - << "-> downward(two_o_sqrt_pi)(as()) = " << eve::downward(eve::two_o_sqrt_pi)(eve::as()) << std::endl - << "-> downward(two_o_sqrt_pi)(as(wxf)) = " << eve::downward(eve::two_o_sqrt_pi)(eve::as(wxf)) << std::endl + << "-> two_o_sqrt_pi[upward](as()) = " << eve::two_o_sqrt_pi[eve::upward](eve::as()) << std::endl + << "-> two_o_sqrt_pi[upward](as(wxf)) = " << eve::two_o_sqrt_pi[eve::upward](eve::as(wxf)) << std::endl + << "-> two_o_sqrt_pi[downward](as()) = " << eve::two_o_sqrt_pi[eve::downward](eve::as()) << std::endl + << "-> two_o_sqrt_pi[downward](as(wxf)) = " << eve::two_o_sqrt_pi[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> two_o_sqrt_pi(as()) = " << eve::two_o_sqrt_pi(eve::as()) << std::endl << "-> two_o_sqrt_pi(as(wxd)) = " << eve::two_o_sqrt_pi(eve::as(wxd)) << std::endl - << "-> upward(two_o_sqrt_pi)(as()) = " << eve::upward(eve::two_o_sqrt_pi)(eve::as()) << std::endl - << "-> upward(two_o_sqrt_pi)(as(wxd)) = " << eve::upward(eve::two_o_sqrt_pi)(eve::as(wxd)) << std::endl - << "-> downward(two_o_sqrt_pi)(as()) = " << eve::downward(eve::two_o_sqrt_pi)(eve::as()) << std::endl - << "-> downward(two_o_sqrt_pi)(as(wxd)) = " << eve::downward(eve::two_o_sqrt_pi)(eve::as(wxd)) << std::endl; + << "-> two_o_sqrt_pi[upward](as()) = " << eve::two_o_sqrt_pi[eve::upward](eve::as()) << std::endl + << "-> two_o_sqrt_pi[upward](as(wxd)) = " << eve::two_o_sqrt_pi[eve::upward](eve::as(wxd)) << std::endl + << "-> two_o_sqrt_pi[downward](as()) = " << eve::two_o_sqrt_pi[eve::downward](eve::as()) << std::endl + << "-> two_o_sqrt_pi[downward](as(wxd)) = " << eve::two_o_sqrt_pi[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/two_pio_3.cpp b/test/doc/math/regular/two_pio_3.cpp index 7a09caa8a0..ce0bbb8037 100644 --- a/test/doc/math/regular/two_pio_3.cpp +++ b/test/doc/math/regular/two_pio_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> two_pio_3(as()) = " << eve::two_pio_3(eve::as()) << std::endl << "-> two_pio_3(as(wxf)) = " << eve::two_pio_3(eve::as(wxf)) << std::endl - << "-> upward(two_pio_3)(as()) = " << eve::upward(eve::two_pio_3)(eve::as()) << std::endl - << "-> upward(two_pio_3)(as(wxf)) = " << eve::upward(eve::two_pio_3)(eve::as(wxf)) << std::endl - << "-> downward(two_pio_3)(as()) = " << eve::downward(eve::two_pio_3)(eve::as()) << std::endl - << "-> downward(two_pio_3)(as(wxf)) = " << eve::downward(eve::two_pio_3)(eve::as(wxf)) << std::endl + << "-> two_pio_3[upward](as()) = " << eve::two_pio_3[eve::upward](eve::as()) << std::endl + << "-> two_pio_3[upward](as(wxf)) = " << eve::two_pio_3[eve::upward](eve::as(wxf)) << std::endl + << "-> two_pio_3[downward](as()) = " << eve::two_pio_3[eve::downward](eve::as()) << std::endl + << "-> two_pio_3[downward](as(wxf)) = " << eve::two_pio_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> two_pio_3(as()) = " << eve::two_pio_3(eve::as()) << std::endl << "-> two_pio_3(as(wxd)) = " << eve::two_pio_3(eve::as(wxd)) << std::endl - << "-> upward(two_pio_3)(as()) = " << eve::upward(eve::two_pio_3)(eve::as()) << std::endl - << "-> upward(two_pio_3)(as(wxd)) = " << eve::upward(eve::two_pio_3)(eve::as(wxd)) << std::endl - << "-> downward(two_pio_3)(as()) = " << eve::downward(eve::two_pio_3)(eve::as()) << std::endl - << "-> downward(two_pio_3)(as(wxd)) = " << eve::downward(eve::two_pio_3)(eve::as(wxd)) << std::endl; + << "-> two_pio_3[upward](as()) = " << eve::two_pio_3[eve::upward](eve::as()) << std::endl + << "-> two_pio_3[upward](as(wxd)) = " << eve::two_pio_3[eve::upward](eve::as(wxd)) << std::endl + << "-> two_pio_3[downward](as()) = " << eve::two_pio_3[eve::downward](eve::as()) << std::endl + << "-> two_pio_3[downward](as(wxd)) = " << eve::two_pio_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/zeta_2.cpp b/test/doc/math/regular/zeta_2.cpp index 9aee284d24..ccc0cc790e 100644 --- a/test/doc/math/regular/zeta_2.cpp +++ b/test/doc/math/regular/zeta_2.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> zeta_2(as()) = " << eve::zeta_2(eve::as()) << std::endl << "-> zeta_2(as(wxf)) = " << eve::zeta_2(eve::as(wxf)) << std::endl - << "-> upward(zeta_2)(as()) = " << eve::upward(eve::zeta_2)(eve::as()) << std::endl - << "-> upward(zeta_2)(as(wxf)) = " << eve::upward(eve::zeta_2)(eve::as(wxf)) << std::endl - << "-> downward(zeta_2)(as()) = " << eve::downward(eve::zeta_2)(eve::as()) << std::endl - << "-> downward(zeta_2)(as(wxf)) = " << eve::downward(eve::zeta_2)(eve::as(wxf)) << std::endl + << "-> zeta_2[upward](as()) = " << eve::zeta_2[eve::upward](eve::as()) << std::endl + << "-> zeta_2[upward](as(wxf)) = " << eve::zeta_2[eve::upward](eve::as(wxf)) << std::endl + << "-> zeta_2[downward](as()) = " << eve::zeta_2[eve::downward](eve::as()) << std::endl + << "-> zeta_2[downward](as(wxf)) = " << eve::zeta_2[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> zeta_2(as()) = " << eve::zeta_2(eve::as()) << std::endl << "-> zeta_2(as(wxd)) = " << eve::zeta_2(eve::as(wxd)) << std::endl - << "-> upward(zeta_2)(as()) = " << eve::upward(eve::zeta_2)(eve::as()) << std::endl - << "-> upward(zeta_2)(as(wxd)) = " << eve::upward(eve::zeta_2)(eve::as(wxd)) << std::endl - << "-> downward(zeta_2)(as()) = " << eve::downward(eve::zeta_2)(eve::as()) << std::endl - << "-> downward(zeta_2)(as(wxd)) = " << eve::downward(eve::zeta_2)(eve::as(wxd)) << std::endl; + << "-> zeta_2[upward](as()) = " << eve::zeta_2[eve::upward](eve::as()) << std::endl + << "-> zeta_2[upward](as(wxd)) = " << eve::zeta_2[eve::upward](eve::as(wxd)) << std::endl + << "-> zeta_2[downward](as()) = " << eve::zeta_2[eve::downward](eve::as()) << std::endl + << "-> zeta_2[downward](as(wxd)) = " << eve::zeta_2[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/doc/math/regular/zeta_3.cpp b/test/doc/math/regular/zeta_3.cpp index 1101bae1d4..d4eb7adc97 100644 --- a/test/doc/math/regular/zeta_3.cpp +++ b/test/doc/math/regular/zeta_3.cpp @@ -14,17 +14,17 @@ int main() std::cout << "---- simd" << std::setprecision(9) << std::endl << "-> zeta_3(as()) = " << eve::zeta_3(eve::as()) << std::endl << "-> zeta_3(as(wxf)) = " << eve::zeta_3(eve::as(wxf)) << std::endl - << "-> upward(zeta_3)(as()) = " << eve::upward(eve::zeta_3)(eve::as()) << std::endl - << "-> upward(zeta_3)(as(wxf)) = " << eve::upward(eve::zeta_3)(eve::as(wxf)) << std::endl - << "-> downward(zeta_3)(as()) = " << eve::downward(eve::zeta_3)(eve::as()) << std::endl - << "-> downward(zeta_3)(as(wxf)) = " << eve::downward(eve::zeta_3)(eve::as(wxf)) << std::endl + << "-> zeta_3[upward](as()) = " << eve::zeta_3[eve::upward](eve::as()) << std::endl + << "-> zeta_3[upward](as(wxf)) = " << eve::zeta_3[eve::upward](eve::as(wxf)) << std::endl + << "-> zeta_3[downward](as()) = " << eve::zeta_3[eve::downward](eve::as()) << std::endl + << "-> zeta_3[downward](as(wxf)) = " << eve::zeta_3[eve::downward](eve::as(wxf)) << std::endl << std::setprecision(17) << "-> zeta_3(as()) = " << eve::zeta_3(eve::as()) << std::endl << "-> zeta_3(as(wxd)) = " << eve::zeta_3(eve::as(wxd)) << std::endl - << "-> upward(zeta_3)(as()) = " << eve::upward(eve::zeta_3)(eve::as()) << std::endl - << "-> upward(zeta_3)(as(wxd)) = " << eve::upward(eve::zeta_3)(eve::as(wxd)) << std::endl - << "-> downward(zeta_3)(as()) = " << eve::downward(eve::zeta_3)(eve::as()) << std::endl - << "-> downward(zeta_3)(as(wxd)) = " << eve::downward(eve::zeta_3)(eve::as(wxd)) << std::endl; + << "-> zeta_3[upward](as()) = " << eve::zeta_3[eve::upward](eve::as()) << std::endl + << "-> zeta_3[upward](as(wxd)) = " << eve::zeta_3[eve::upward](eve::as(wxd)) << std::endl + << "-> zeta_3[downward](as()) = " << eve::zeta_3[eve::downward](eve::as()) << std::endl + << "-> zeta_3[downward](as(wxd)) = " << eve::zeta_3[eve::downward](eve::as(wxd)) << std::endl; float xf; double xd; diff --git a/test/test.hpp b/test/test.hpp index 5ed5ee48a1..512da8f328 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -110,6 +110,19 @@ namespace tts } } +namespace tts +{ + + template auto as_value(V const&); + +template + auto as_value(V const& v) + requires( requires { v(eve::as{}); } ) + { + return v(eve::as{}); + } +} + #include //================================================================================================== @@ -183,6 +196,12 @@ namespace eve::test , eve::fixed< 512> , eve::fixed<1024> >; + + EVE_FORCEINLINE auto is_near(auto a, auto b){ + return eve::if_else( a < b + , (eve::next(a) == b) && (eve::prev(b) == a) + , a == b); + } } namespace eve::test::scalar @@ -210,6 +229,8 @@ namespace eve::test::simd //================================================================================================== // EVE Data generators //================================================================================================== + + namespace eve::detail { template auto as_value(callable_object const& v) @@ -218,8 +239,11 @@ namespace eve::detail } } + + namespace tts { + template struct bunch { template struct make; diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 998d339afe..5f5870036b 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -100,6 +100,7 @@ glob_unit("unit" ${unit_root} "module/elliptic/*.cpp" ) add_custom_target(unit.math.exe ) add_dependencies(unit.exe unit.math.exe ) glob_unit("unit" ${unit_root} "module/math/*.cpp" ) +glob_unit("unit" ${unit_root} "module/math/constant/*.cpp" ) add_custom_target(unit.polynomial.exe ) add_dependencies(unit.exe unit.polynomial.exe ) diff --git a/test/unit/module/math/constant/catalan.cpp b/test/unit/module/math/constant/catalan.cpp new file mode 100644 index 0000000000..e98f386f5a --- /dev/null +++ b/test/unit/module/math/constant/catalan.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// catalan Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of catalan", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::catalan(as()), T); + TTS_EXPR_IS(eve::catalan(as()), v_t); +}; +//================================================================================================== +// catalan tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of catalan on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::catalan[eve::downward](eve::as()) <= 0.915965594177219015054603l); + TTS_EXPECT(eve::catalan[eve::upward](eve::as()) >= 0.915965594177219015054603l); + } + TTS_EQUAL(eve::catalan(eve::as()), T(0.915965594177219015054603l)); +}; + +//================================================================================================== +// catalan tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of catalan on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::catalan[eve::downward](as()), eve::catalan[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked catalan +//================================================================================================== +TTS_CASE_WITH("Check behavior of catalan[mask] on wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::catalan[mask](eve::as(a0)), eve::if_else(mask, eve::catalan(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/cbrt_pi.cpp b/test/unit/module/math/constant/cbrt_pi.cpp new file mode 100644 index 0000000000..1d592fe306 --- /dev/null +++ b/test/unit/module/math/constant/cbrt_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// cbrt_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of cbrt_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::cbrt_pi(as()), T); + TTS_EXPR_IS(eve::cbrt_pi(as()), v_t); +}; +//================================================================================================== +// cbrt_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of cbrt_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::cbrt_pi[eve::downward](eve::as()) <= std::cbrt(3.141592653589793238462643l)); + TTS_EXPECT(eve::cbrt_pi[eve::upward](eve::as()) >= std::cbrt(3.141592653589793238462643l)); + } + TTS_ULP_EQUAL(eve::cbrt_pi(eve::as()), T(std::cbrt(3.141592653589793238462643l)), 0.5); +}; + +//================================================================================================== +// cbrt_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of cbrt_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::cbrt_pi[eve::downward](as()), eve::cbrt_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked cbrt_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of cbrt_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::cbrt_pi[mask](eve::as(a0)), eve::if_else(mask, eve::cbrt_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/cos_1.cpp b/test/unit/module/math/constant/cos_1.cpp new file mode 100644 index 0000000000..eff2fd2de6 --- /dev/null +++ b/test/unit/module/math/constant/cos_1.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// cos_1 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of cos_1", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::cos_1(as()), T); + TTS_EXPR_IS(eve::cos_1(as()), v_t); +}; +//================================================================================================== +// cos_1 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of cos_1 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::cos_1[eve::downward](eve::as()) <= std::cos(1.0l)); + TTS_EXPECT(eve::cos_1[eve::upward](eve::as()) >= std::cos(1.0l)); + } + TTS_EQUAL(eve::cos_1(eve::as()), T(std::cos(1.0l))); +}; + +//================================================================================================== +// cos_1 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of cos_1 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::cos_1[eve::downward](as()), eve::cos_1[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked cos_1 +//================================================================================================== +TTS_CASE_WITH("Check behavior of cos_1[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::cos_1[mask](eve::as(a0)), eve::if_else(mask, eve::cos_1(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/cosh_1.cpp b/test/unit/module/math/constant/cosh_1.cpp new file mode 100644 index 0000000000..21cf5527a2 --- /dev/null +++ b/test/unit/module/math/constant/cosh_1.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// cosh_1 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of cosh_1", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::cosh_1(as()), T); + TTS_EXPR_IS(eve::cosh_1(as()), v_t); +}; +//================================================================================================== +// cosh_1 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of cosh_1 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::cosh_1[eve::downward](eve::as()) <= std::cosh(1.0l)); + TTS_EXPECT(eve::cosh_1[eve::upward](eve::as()) >= std::cosh(1.0l)); + } + TTS_EQUAL(eve::cosh_1(eve::as()), T(std::cosh(1.0l))); +}; + +//================================================================================================== +// cosh_1 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of cosh_1 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::cosh_1[eve::downward](as()), eve::cosh_1[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked cosh_1 +//================================================================================================== +TTS_CASE_WITH("Check behavior of cosh_1[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::cosh_1[mask](eve::as(a0)), eve::if_else(mask, eve::cosh_1(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/egamma.cpp b/test/unit/module/math/constant/egamma.cpp new file mode 100644 index 0000000000..03b041d2b3 --- /dev/null +++ b/test/unit/module/math/constant/egamma.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of egamma", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::egamma(as()), T); + TTS_EXPR_IS(eve::egamma(as()), v_t); +}; +//================================================================================================== +// e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::egamma[eve::downward](as()) < 0.57721566490153286060651209008l); + TTS_EXPECT(eve::egamma[eve::upward](as()) > 0.57721566490153286060651209008l); + } + TTS_EQUAL(eve::egamma(as()), T(0.57721566490153286060651209008l)); +}; + +//================================================================================================== +// e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::egamma[eve::downward](as()), eve::egamma[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked egamma +//================================================================================================== +TTS_CASE_WITH("Check behavior of egamma[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::egamma[mask](eve::as(a0)), eve::if_else(mask, eve::egamma(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/egamma_sqr.cpp b/test/unit/module/math/constant/egamma_sqr.cpp new file mode 100644 index 0000000000..b288f36f0d --- /dev/null +++ b/test/unit/module/math/constant/egamma_sqr.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// egamma_sqr Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of egamma_sqr", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::egamma_sqr(as()), T); + TTS_EXPR_IS(eve::egamma_sqr(as()), v_t); +}; +//================================================================================================== +// egamma_sqr tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of egamma_sqr on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::egamma_sqr[eve::downward](eve::as()) <= 0.57721566490153286060651209008l*0.57721566490153286060651209008l); + TTS_EXPECT(eve::egamma_sqr[eve::upward](eve::as()) >= 0.57721566490153286060651209008l*0.57721566490153286060651209008l); + } + TTS_EQUAL(eve::egamma_sqr(eve::as()), T(0.57721566490153286060651209008l*0.57721566490153286060651209008l)); +}; + +//================================================================================================== +// egamma_sqr tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of egamma_sqr on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::egamma_sqr[eve::downward](as()), eve::egamma_sqr[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked egamma_sqr +//================================================================================================== +TTS_CASE_WITH("Check behavior of egamma_sqr[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::egamma_sqr[mask](eve::as(a0)), eve::if_else(mask, eve::egamma_sqr(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/epso_2.cpp b/test/unit/module/math/constant/epso_2.cpp new file mode 100644 index 0000000000..8cb8a59424 --- /dev/null +++ b/test/unit/module/math/constant/epso_2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// epso_2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of epso_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::epso_2(as()), T); + TTS_EXPR_IS(eve::epso_2(as()), v_t); +}; +//================================================================================================== +// epso_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of epso_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::epso_2[eve::downward](eve::as()) <= eve::eps(eve::as())/2); + TTS_EXPECT(eve::epso_2[eve::upward](eve::as()) >= eve::eps(eve::as())/2); + } + TTS_EQUAL(eve::epso_2(eve::as()), T(eve::eps(eve::as())/2)); +}; + +//================================================================================================== +// epso_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of epso_2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::epso_2[eve::downward](as()), eve::epso_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked epso_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of epso_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::epso_2[mask](eve::as(a0)), eve::if_else(mask, eve::epso_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/euler.cpp b/test/unit/module/math/constant/euler.cpp new file mode 100644 index 0000000000..bf1ec6bf66 --- /dev/null +++ b/test/unit/module/math/constant/euler.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of euler", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::euler(as()), T); + TTS_EXPR_IS(eve::euler(as()), v_t); +}; +//================================================================================================== +// e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::euler[eve::downward](as()) < std::exp(1.0l)); + TTS_EXPECT(eve::euler[eve::upward](as()) > std::exp(1.0l)); + } + TTS_EQUAL(eve::euler(as()), T(std::exp(1.0l))); +}; + +//================================================================================================== +// e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::euler[eve::downward](as()), eve::euler[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked euler +//================================================================================================== +TTS_CASE_WITH("Check behavior of euler[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::euler[mask](eve::as(a0)), eve::if_else(mask, eve::euler(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/exp_pi.cpp b/test/unit/module/math/constant/exp_pi.cpp new file mode 100644 index 0000000000..546c591fb1 --- /dev/null +++ b/test/unit/module/math/constant/exp_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// exp_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of exp_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::exp_pi(as()), T); + TTS_EXPR_IS(eve::exp_pi(as()), v_t); +}; +//================================================================================================== +// exp_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of exp_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::exp_pi[eve::downward](eve::as()) <= std::exp(3.141592653589793238462643l)); + TTS_EXPECT(eve::exp_pi[eve::upward](eve::as()) >= std::exp(3.141592653589793238462643l)); + } + TTS_ULP_EQUAL(eve::exp_pi(eve::as()), T(std::exp(3.141592653589793238462643l)), 0.5); +}; + +//================================================================================================== +// exp_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of exp_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::exp_pi[eve::downward](as()), eve::exp_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked exp_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of exp_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::exp_pi[mask](eve::as(a0)), eve::if_else(mask, eve::exp_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/four_minus_pi.cpp b/test/unit/module/math/constant/four_minus_pi.cpp new file mode 100644 index 0000000000..77a43b74b0 --- /dev/null +++ b/test/unit/module/math/constant/four_minus_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// four_minus_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of four_minus_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::four_minus_pi(as()), T); + TTS_EXPR_IS(eve::four_minus_pi(as()), v_t); +}; +//================================================================================================== +// four_minus_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of four_minus_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::four_minus_pi[eve::downward](eve::as()) <= 4.0l-3.141592653589793238462643l); + TTS_EXPECT(eve::four_minus_pi[eve::upward](eve::as()) >= 4.0l-3.141592653589793238462643l); + } + TTS_ULP_EQUAL(eve::four_minus_pi(eve::as()), T(4.0l-3.141592653589793238462643l), 0.5); +}; + +//================================================================================================== +// four_minus_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of four_minus_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::four_minus_pi[eve::downward](as()), eve::four_minus_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked four_minus_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of four_minus_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::four_minus_pi[mask](eve::as(a0)), eve::if_else(mask, eve::four_minus_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/four_pio_3.cpp b/test/unit/module/math/constant/four_pio_3.cpp new file mode 100644 index 0000000000..87fdd75f1f --- /dev/null +++ b/test/unit/module/math/constant/four_pio_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// four_pio_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of four_pio_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::four_pio_3(as()), T); + TTS_EXPR_IS(eve::four_pio_3(as()), v_t); +}; +//================================================================================================== +// four_pio_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of four_pio_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::four_pio_3[eve::downward](eve::as()) <= 4*3.141592653589793238462643l/3); + TTS_EXPECT(eve::four_pio_3[eve::upward](eve::as()) >= 4*3.141592653589793238462643l/3); + } + TTS_ULP_EQUAL(eve::four_pio_3(eve::as()), T(4*3.141592653589793238462643l/3), 0.5); +}; + +//================================================================================================== +// four_pio_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of four_pio_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::four_pio_3[eve::downward](as()), eve::four_pio_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked four_pio_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of four_pio_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::four_pio_3[mask](eve::as(a0)), eve::if_else(mask, eve::four_pio_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/glaisher.cpp b/test/unit/module/math/constant/glaisher.cpp new file mode 100644 index 0000000000..03fdb9a500 --- /dev/null +++ b/test/unit/module/math/constant/glaisher.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// glaisher Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of glaisher", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::glaisher(as()), T); + TTS_EXPR_IS(eve::glaisher(as()), v_t); +}; +//================================================================================================== +// glaisher tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of glaisher on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::glaisher[eve::downward](eve::as()) <= 1.28242712910062263687l); + TTS_EXPECT(eve::glaisher[eve::upward](eve::as()) >= 1.28242712910062263687l); + } + TTS_EQUAL(eve::glaisher(eve::as()), T(1.28242712910062263687l)); +}; + +//================================================================================================== +// glaisher tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of glaisher on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::glaisher[eve::downward](as()), eve::glaisher[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked glaisher +//================================================================================================== +TTS_CASE_WITH("Check behavior of glaisher[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::glaisher[mask](eve::as(a0)), eve::if_else(mask, eve::glaisher(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/inv_2eps.cpp b/test/unit/module/math/constant/inv_2eps.cpp new file mode 100644 index 0000000000..ecd207f3a2 --- /dev/null +++ b/test/unit/module/math/constant/inv_2eps.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// inv_2eps Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of inv_2eps", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::inv_2eps(as()), T); + TTS_EXPR_IS(eve::inv_2eps(as()), v_t); +}; +//================================================================================================== +// inv_2eps tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_2eps on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::inv_2eps[eve::downward](eve::as()) <= 0.5/eve::eps(eve::as())); + TTS_EXPECT(eve::inv_2eps[eve::upward](eve::as()) >= 0.5/eve::eps(eve::as())); + } + TTS_EQUAL(eve::inv_2eps(eve::as()), T(0.5/eve::eps(eve::as()))); +}; + +//================================================================================================== +// inv_2eps tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_2eps on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::inv_2eps[eve::downward](as()), eve::inv_2eps[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked inv_2eps +//================================================================================================== +TTS_CASE_WITH("Check behavior of inv_2eps[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::inv_2eps[mask](eve::as(a0)), eve::if_else(mask, eve::inv_2eps(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/inv_2pi.cpp b/test/unit/module/math/constant/inv_2pi.cpp new file mode 100644 index 0000000000..ee117e59ed --- /dev/null +++ b/test/unit/module/math/constant/inv_2pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// inv_2pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of inv_2pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::inv_2pi(as()), T); + TTS_EXPR_IS(eve::inv_2pi(as()), v_t); +}; +//================================================================================================== +// inv_2pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_2pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::inv_2pi[eve::downward](eve::as()) <= 0.5l/3.141592653589793238462643l); + TTS_EXPECT(eve::inv_2pi[eve::upward](eve::as()) >= 0.5l/3.141592653589793238462643l); + } + TTS_EQUAL(eve::inv_2pi(eve::as()), T(0.5l/3.141592653589793238462643l)); +}; + +//================================================================================================== +// inv_2pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_2pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::inv_2pi[eve::downward](as()), eve::inv_2pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked inv_2pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of inv_2pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::inv_2pi[mask](eve::as(a0)), eve::if_else(mask, eve::inv_2pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/inv_e.cpp b/test/unit/module/math/constant/inv_e.cpp new file mode 100644 index 0000000000..8515021d40 --- /dev/null +++ b/test/unit/module/math/constant/inv_e.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// inv_e Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of inv_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::inv_e(as()), T); + TTS_EXPR_IS(eve::inv_e(as()), v_t); +}; +//================================================================================================== +// inv_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::inv_e[eve::downward](eve::as()) <= std::exp(-1.0l)); + TTS_EXPECT(eve::inv_e[eve::upward](eve::as()) >= std::exp(-1.0l)); + } + TTS_EQUAL(eve::inv_e(eve::as()), T(std::exp(-1.0l))); +}; + +//================================================================================================== +// inv_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_e on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::inv_e[eve::downward](as()), eve::inv_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked inv_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of inv_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::inv_e[mask](eve::as(a0)), eve::if_else(mask, eve::inv_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/inv_egamma.cpp b/test/unit/module/math/constant/inv_egamma.cpp new file mode 100644 index 0000000000..34791e1e4c --- /dev/null +++ b/test/unit/module/math/constant/inv_egamma.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// inv_egamma Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of inv_egamma", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::inv_egamma(as()), T); + TTS_EXPR_IS(eve::inv_egamma(as()), v_t); +}; +//================================================================================================== +// inv_egamma tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_egamma on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::inv_egamma[eve::downward](eve::as()) <= 1.0l/0.57721566490153286060651209008l); + TTS_EXPECT(eve::inv_egamma[eve::upward](eve::as()) >= 1.0l/0.57721566490153286060651209008l); + } + TTS_EQUAL(eve::inv_egamma(eve::as()), T(1.0l/0.57721566490153286060651209008l)); +}; + +//================================================================================================== +// inv_egamma tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_egamma on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::inv_egamma[eve::downward](as()), eve::inv_egamma[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked inv_egamma +//================================================================================================== +TTS_CASE_WITH("Check behavior of inv_egamma[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::inv_egamma[mask](eve::as(a0)), eve::if_else(mask, eve::inv_egamma(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/inv_pi.cpp b/test/unit/module/math/constant/inv_pi.cpp new file mode 100644 index 0000000000..9139d6f9fe --- /dev/null +++ b/test/unit/module/math/constant/inv_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// inv_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of inv_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::inv_pi(as()), T); + TTS_EXPR_IS(eve::inv_pi(as()), v_t); +}; +//================================================================================================== +// inv_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::inv_pi[eve::downward](eve::as()) <= 1.0l/3.141592653589793238462643l); + TTS_EXPECT(eve::inv_pi[eve::upward](eve::as()) >= 1.0l/3.141592653589793238462643l); + } + TTS_EQUAL(eve::inv_pi(eve::as()), T(1.0l/3.141592653589793238462643l)); +}; + +//================================================================================================== +// inv_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of inv_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::inv_pi[eve::downward](as()), eve::inv_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked inv_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of inv_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::inv_pi[mask](eve::as(a0)), eve::if_else(mask, eve::inv_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/invcbrt_pi.cpp b/test/unit/module/math/constant/invcbrt_pi.cpp new file mode 100644 index 0000000000..aca76ebcb3 --- /dev/null +++ b/test/unit/module/math/constant/invcbrt_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// invcbrt_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of invcbrt_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::invcbrt_pi(as()), T); + TTS_EXPR_IS(eve::invcbrt_pi(as()), v_t); +}; +//================================================================================================== +// invcbrt_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invcbrt_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::invcbrt_pi[eve::downward](eve::as()) <= 1.0l/std::cbrt(3.141592653589793238462643l)); + TTS_EXPECT(eve::invcbrt_pi[eve::upward](eve::as()) >= 1.0l/std::cbrt(3.141592653589793238462643l)); + } + TTS_EQUAL(eve::invcbrt_pi(eve::as()), T(1.0l/std::cbrt(3.141592653589793238462643l))); +}; + +//================================================================================================== +// invcbrt_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invcbrt_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::invcbrt_pi[eve::downward](as()), eve::invcbrt_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invcbrt_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of invcbrt_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invcbrt_pi[mask](eve::as(a0)), eve::if_else(mask, eve::invcbrt_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/invlog10_2.cpp b/test/unit/module/math/constant/invlog10_2.cpp similarity index 51% rename from test/unit/module/math/invlog10_2.cpp rename to test/unit/module/math/constant/invlog10_2.cpp index b313c59684..08ebc77337 100644 --- a/test/unit/module/math/invlog10_2.cpp +++ b/test/unit/module/math/constant/invlog10_2.cpp @@ -24,11 +24,10 @@ TTS_CASE_TPL("Check return types of invlog10_2", eve::test::simd::ieee_reals) TTS_EXPR_IS(eve::invlog10_2(as()), T); TTS_EXPR_IS(eve::invlog10_2(as()), v_t); }; - //================================================================================================== -// invlog10_2 tests +// invlog10_2 tests on scalar //================================================================================================== -TTS_CASE_TPL("Check behavior of invlog10_2 on wide", eve::test::simd::ieee_reals) +TTS_CASE_TPL("Check behavior of invlog10_2 on scalar", eve::test::scalar::ieee_reals) (tts::type) { using eve::as; @@ -38,13 +37,36 @@ TTS_CASE_TPL("Check behavior of invlog10_2 on wide", eve::test::simd::ieee_reals using elt_t = eve::element_type_t; if constexpr( sizeof(long double) > sizeof(elt_t) ) { - TTS_EXPECT(downward(eve::invlog10_2)(as()) + TTS_EXPECT(eve::invlog10_2[eve::downward](as()) < 3.3219280948873623478703194294893901758648313930246l); - TTS_EXPECT(upward(eve::invlog10_2)(as()) + TTS_EXPECT(eve::invlog10_2[eve::upward](as()) > 3.3219280948873623478703194294893901758648313930246l); } TTS_EQUAL(eve::invlog10_2(as()), T(3.3219280948873623478703194294893901758648313930246l)); - TTS_EXPECT(eve::all(downward(eve::invlog10_2)(as()) <= eve::invlog10_2(as()))); - TTS_EXPECT(eve::all(eve::invlog10_2(as()) <= upward(eve::invlog10_2)(as()))); - TTS_ULP_EQUAL(downward(eve::invlog10_2)(as()), upward(eve::invlog10_2)(as()), 0.5); +}; + +//================================================================================================== +// invlog10_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog10_2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::invlog10_2[eve::downward](as())), eve::invlog10_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invlog10_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of invlog10_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invlog10_2[mask](eve::as(a0)), eve::if_else(mask, eve::invlog10_2(eve::as(a0)), eve::zero)); }; diff --git a/test/unit/module/math/constant/invlog10_e.cpp b/test/unit/module/math/constant/invlog10_e.cpp new file mode 100644 index 0000000000..9de1ac0df8 --- /dev/null +++ b/test/unit/module/math/constant/invlog10_e.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// invlog10_e Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of invlog10_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::invlog10_e(as()), T); + TTS_EXPR_IS(eve::invlog10_e(as()), v_t); +}; +//================================================================================================== +// invlog10_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog10_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::invlog10_e[eve::downward](eve::as()) <= 1.0l/std::log10(std::exp(1.0l))); + TTS_EXPECT(eve::invlog10_e[eve::upward](eve::as()) >= 1.0l/std::log10(std::exp(1.0l))); + } + TTS_EQUAL(eve::invlog10_e(eve::as()), T(1.0l/std::log10(std::exp(1.0l)))); +}; + +//================================================================================================== +// invlog10_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog10_e on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::invlog10_e[eve::downward](as()), eve::invlog10_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invlog10_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of invlog10_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invlog10_e[mask](eve::as(a0)), eve::if_else(mask, eve::invlog10_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/invlog_10.cpp b/test/unit/module/math/constant/invlog_10.cpp similarity index 52% rename from test/unit/module/math/invlog_10.cpp rename to test/unit/module/math/constant/invlog_10.cpp index bd0214337f..7306851bb1 100644 --- a/test/unit/module/math/invlog_10.cpp +++ b/test/unit/module/math/constant/invlog_10.cpp @@ -25,28 +25,48 @@ TTS_CASE_TPL("Check return types of invlog10", eve::test::simd::ieee_reals) TTS_EXPR_IS(eve::invlog_10(as()), T); TTS_EXPR_IS(eve::invlog_10(as()), v_t); }; +//================================================================================================== +// invlog_10 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog_10 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EQUAL(eve::invlog_10(as()), T(0.43429448190325182765112891891660508229439700580367l)); +}; //================================================================================================== -// invlog_10 tests +// invlog_10 tests on wide //================================================================================================== -TTS_CASE_TPL("Check behavior of invlog_10 on wide", eve::test::simd::ieee_reals) +TTS_CASE_TPL("Check behavior of invlog_10 on scalar", eve::test::simd::ieee_reals) (tts::type) { using eve::as; using eve::downward; using eve::upward; using elt_t = eve::element_type_t; - TTS_EQUAL(eve::invlog_10(as()), T(0.43429448190325182765112891891660508229439700580367l)); if constexpr( sizeof(long double) > sizeof(elt_t) ) { - TTS_EXPECT(downward(eve::invlog_10)(as()) + TTS_EXPECT(eve::invlog_10[eve::downward](as()) < 0.43429448190325182765112891891660508229439700580367l); - TTS_EXPECT(upward(eve::invlog_10)(as()) + TTS_EXPECT(eve::invlog_10[eve::upward](as()) > 0.43429448190325182765112891891660508229439700580367l); } - TTS_ULP_EQUAL( - eve::invlog_10(as()), T(0.43429448190325182765112891891660508229439700580367l), 0.0); - TTS_EXPECT(eve::all(downward(eve::invlog_10)(as()) <= eve::invlog_10(as()))); - TTS_EXPECT(eve::all(eve::invlog_10(as()) <= upward(eve::invlog_10)(as()))); - TTS_ULP_EQUAL(downward(eve::invlog_10)(as()), upward(eve::invlog_10)(as()), 0.5); + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::invlog_10[eve::downward](as())), eve::invlog_10[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invlog_10 +//================================================================================================== +TTS_CASE_WITH("Check behavior of invlog_10[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invlog_10[mask](eve::as(a0)), eve::if_else(mask, eve::invlog_10(eve::as(a0)), eve::zero)); }; diff --git a/test/unit/module/math/constant/invlog_2.cpp b/test/unit/module/math/constant/invlog_2.cpp new file mode 100644 index 0000000000..29fafaae5d --- /dev/null +++ b/test/unit/module/math/constant/invlog_2.cpp @@ -0,0 +1,72 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of invlog_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::invlog_2(as()), T); + TTS_EXPR_IS(eve::invlog_2(as()), v_t); +}; +//================================================================================================== +// invlog_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::invlog_2[eve::downward](as()) + < 1.442695040888963407359924681001892137426645954153l); + TTS_EXPECT(eve::invlog_2[eve::upward](as()) + > 1.442695040888963407359924681001892137426645954153l); + } + TTS_IEEE_EQUAL(eve::invlog_2(as()), T(1.442695040888963407359924681001892137426645954153l)); +}; + +//================================================================================================== +// invlog_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog_2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::invlog_2[eve::downward](as())), eve::invlog_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invlog_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of invlog_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invlog_2[mask](eve::as(a0)), eve::if_else(mask, eve::invlog_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/invlog_phi.cpp b/test/unit/module/math/constant/invlog_phi.cpp new file mode 100644 index 0000000000..f08fef83d5 --- /dev/null +++ b/test/unit/module/math/constant/invlog_phi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// invlog_phi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of invlog_phi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::invlog_phi(as()), T); + TTS_EXPR_IS(eve::invlog_phi(as()), v_t); +}; +//================================================================================================== +// invlog_phi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog_phi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::invlog_phi[eve::downward](eve::as()) <= 1.0l/std::log(1.618033988749894848204586l)); + TTS_EXPECT(eve::invlog_phi[eve::upward](eve::as()) >= 1.0l/std::log(1.618033988749894848204586l)); + } + TTS_ULP_EQUAL(eve::invlog_phi(eve::as()), T(1.0l/std::log(1.618033988749894848204586l)), 0.5); +}; + +//================================================================================================== +// invlog_phi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invlog_phi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::invlog_phi[eve::downward](as()), eve::invlog_phi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invlog_phi +//================================================================================================== +TTS_CASE_WITH("Check behavior of invlog_phi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invlog_phi[mask](eve::as(a0)), eve::if_else(mask, eve::invlog_phi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/invsqrt_2.cpp b/test/unit/module/math/constant/invsqrt_2.cpp new file mode 100644 index 0000000000..92d91e25dd --- /dev/null +++ b/test/unit/module/math/constant/invsqrt_2.cpp @@ -0,0 +1,72 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of invsqrt_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::invsqrt_2(as()), T); + TTS_EXPR_IS(eve::invsqrt_2(as()), v_t); +}; +//================================================================================================== +// invsqrt_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of invsqrt_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::invsqrt_2[eve::downward](as()) <= (1.0l / (std::sqrt(2.0l)))); + TTS_EXPECT(eve::invsqrt_2[eve::upward](as()) >= (1.0l / (std::sqrt(2.0l)))); + } + TTS_ULP_EQUAL(eve::invsqrt_2(as()), T(1.0l / (std::sqrt(2.0l))), 0.5); +}; + +//================================================================================================== +// invsqrt_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of invsqrt_2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::invsqrt_2[eve::upward](as()) >= eve::invsqrt_2(as()))); + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::invsqrt_2[eve::downward](as())), eve::invsqrt_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked invsqrt_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of invsqrt_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::invsqrt_2[mask](eve::as(a0)), eve::if_else(mask, eve::invsqrt_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/khinchin.cpp b/test/unit/module/math/constant/khinchin.cpp new file mode 100644 index 0000000000..13d8898c89 --- /dev/null +++ b/test/unit/module/math/constant/khinchin.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// khinchin Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of khinchin", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::khinchin(as()), T); + TTS_EXPR_IS(eve::khinchin(as()), v_t); +}; +//================================================================================================== +// khinchin tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of khinchin on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::khinchin[eve::downward](eve::as()) <=2.685452001065306445309714 ); + TTS_EXPECT(eve::khinchin[eve::upward](eve::as()) >= 2.685452001065306445309714); + } + TTS_EQUAL(eve::khinchin(eve::as()), T(2.685452001065306445309714)); +}; + +//================================================================================================== +// khinchin tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of khinchin on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::khinchin[eve::downward](as()), eve::khinchin[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked khinchin +//================================================================================================== +TTS_CASE_WITH("Check behavior of khinchin[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::khinchin[mask](eve::as(a0)), eve::if_else(mask, eve::khinchin(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/log10_e.cpp b/test/unit/module/math/constant/log10_e.cpp new file mode 100644 index 0000000000..f393a53f20 --- /dev/null +++ b/test/unit/module/math/constant/log10_e.cpp @@ -0,0 +1,71 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of log10_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::log10_e(as()), T); + TTS_EXPR_IS(eve::log10_e(as()), v_t); +}; +//================================================================================================== +// log10_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of log10_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::log10_e[eve::downward](as()) < std::log10(std::exp(1.0l))); + TTS_EXPECT(eve::log10_e[eve::upward](as()) > std::log10(std::exp(1.0l))); + } + TTS_IEEE_EQUAL(eve::log10_e(as()), T(std::log10(std::exp(1.0l)))); +}; + +//================================================================================================== +// log10_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of log10_e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::log10_e[eve::downward](as())), eve::log10_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked log10_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of log10_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::log10_e[mask](eve::as(a0)), eve::if_else(mask, eve::log10_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/log2_e.cpp b/test/unit/module/math/constant/log2_e.cpp new file mode 100644 index 0000000000..7f6bef24b2 --- /dev/null +++ b/test/unit/module/math/constant/log2_e.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of log2_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::log2_e(as()), T); + TTS_EXPR_IS(eve::log2_e(as()), v_t); +}; +//================================================================================================== +// log2_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of log2_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::log2_e[eve::downward](as()) < std::log2(std::exp(1.0l))); + TTS_EXPECT(eve::log2_e[eve::upward](as()) > std::log2(std::exp(1.0l))); + } + TTS_IEEE_EQUAL(eve::log2_e(as()), T(std::log2(std::exp(1.0l)))); +}; + +//================================================================================================== +// log2_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of log2_e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::log2_e[eve::downward](as())), eve::log2_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked log2_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of log2_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::log2_e[mask](eve::as(a0)), eve::if_else(mask, eve::log2_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/log_10.cpp b/test/unit/module/math/constant/log_10.cpp new file mode 100644 index 0000000000..548e32798f --- /dev/null +++ b/test/unit/module/math/constant/log_10.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of log_10", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::log_10(as()), T); + TTS_EXPR_IS(eve::log_10(as()), v_t); +}; +//================================================================================================== +// log_10 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_10 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::log_10[eve::downward](as()) < std::log(10.0l)); + TTS_EXPECT(eve::log_10[eve::upward](as()) > std::log(10.0l)); + } + TTS_IEEE_EQUAL(eve::log_10(as()), T(std::log(10.0l))); +}; + +//================================================================================================== +// log_10 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_10 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::log_10[eve::downward](as())), eve::log_10[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked log_10 +//================================================================================================== +TTS_CASE_WITH("Check behavior of log_10[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::log_10[mask](eve::as(a0)), eve::if_else(mask, eve::log_10(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/log_2.cpp b/test/unit/module/math/constant/log_2.cpp new file mode 100644 index 0000000000..f09248cad1 --- /dev/null +++ b/test/unit/module/math/constant/log_2.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of log_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::log_2(as()), T); + TTS_EXPR_IS(eve::log_2(as()), v_t); +}; +//================================================================================================== +// log_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::log_2[eve::downward](as()) < std::log(2.0l)); + TTS_EXPECT(eve::log_2[eve::upward](as()) > std::log(2.0l)); + } + TTS_IEEE_EQUAL(eve::log_2(as()), T(std::log(2.0l))); +}; + +//================================================================================================== +// log_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::log_2[eve::downward](as())), eve::log_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked log_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of log_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::log_2[mask](eve::as(a0)), eve::if_else(mask, eve::log_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/log_phi.cpp b/test/unit/module/math/constant/log_phi.cpp new file mode 100644 index 0000000000..cb92a6fa13 --- /dev/null +++ b/test/unit/module/math/constant/log_phi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// log_phi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of log_phi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::log_phi(as()), T); + TTS_EXPR_IS(eve::log_phi(as()), v_t); +}; +//================================================================================================== +// log_phi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_phi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::log_phi[eve::downward](eve::as()) <= std::log(1.618033988749894848204586l)); + TTS_EXPECT(eve::log_phi[eve::upward](eve::as()) >= std::log(1.618033988749894848204586l)); + } + TTS_EQUAL(eve::log_phi(eve::as()), T(std::log(1.618033988749894848204586l))); +}; + +//================================================================================================== +// log_phi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of log_phi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::log_phi[eve::downward](as()), eve::log_phi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked log_phi +//================================================================================================== +TTS_CASE_WITH("Check behavior of log_phi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::log_phi[mask](eve::as(a0)), eve::if_else(mask, eve::log_phi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/loglog_2.cpp b/test/unit/module/math/constant/loglog_2.cpp new file mode 100644 index 0000000000..81c1a5e6e3 --- /dev/null +++ b/test/unit/module/math/constant/loglog_2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// loglog_2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of loglog_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::loglog_2(as()), T); + TTS_EXPR_IS(eve::loglog_2(as()), v_t); +}; +//================================================================================================== +// loglog_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of loglog_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::loglog_2[eve::downward](eve::as()) <= -0.36651292058166432701243915823267l); + TTS_EXPECT(eve::loglog_2[eve::upward](eve::as()) >= -0.36651292058166432701243915823267l); + } + TTS_EQUAL(eve::loglog_2(eve::as()), T(std::log(std::log(2.0l)))); +}; + +//================================================================================================== +// loglog_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of loglog_2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::loglog_2[eve::downward](as()), eve::loglog_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked loglog_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of loglog_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::loglog_2[mask](eve::as(a0)), eve::if_else(mask, eve::loglog_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/maxlog.cpp b/test/unit/module/math/constant/maxlog.cpp new file mode 100644 index 0000000000..018b201c32 --- /dev/null +++ b/test/unit/module/math/constant/maxlog.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of maxlog", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::maxlog(as()), T); + TTS_EXPR_IS(eve::maxlog(as()), v_t); +}; +//================================================================================================== +// maxlog tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::maxlog(as())), eve::inf(as())); +}; + +//================================================================================================== +// maxlog tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::maxlog(as())), eve::inf(as())); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog(as())))))); + TTS_EXPECT(eve::all(eve::test::is_near(eve::maxlog[eve::downward](as()), eve::maxlog[eve::upward](as())))); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog(as())))))); +}; + + +//================================================================================================== +// simd Tests for masked maxlog +//================================================================================================== +TTS_CASE_WITH("Check behavior of maxlog[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::maxlog[mask](eve::as(a0)), eve::if_else(mask, eve::maxlog(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/maxlog10.cpp b/test/unit/module/math/constant/maxlog10.cpp new file mode 100644 index 0000000000..ad657964f9 --- /dev/null +++ b/test/unit/module/math/constant/maxlog10.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of maxlog10", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::maxlog10(as()), T); + TTS_EXPR_IS(eve::maxlog10(as()), v_t); +}; +//================================================================================================== +// maxlog10 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog10 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp10(eve::maxlog10(as())), eve::inf(as())); +}; + +//================================================================================================== +// maxlog10 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog10 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp10(eve::maxlog10(as())), eve::inf(as())); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog10(as())))))); + TTS_EXPECT(eve::all(eve::test::is_near(eve::maxlog10[eve::downward](as()), eve::maxlog10[eve::upward](as())))); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog10(as())))))); +}; + + +//================================================================================================== +// simd Tests for masked maxlog10 +//================================================================================================== +TTS_CASE_WITH("Check behavior of maxlog10[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::maxlog10[mask](eve::as(a0)), eve::if_else(mask, eve::maxlog10(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/maxlog2.cpp b/test/unit/module/math/constant/maxlog2.cpp new file mode 100644 index 0000000000..ba70c7857e --- /dev/null +++ b/test/unit/module/math/constant/maxlog2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of maxlog2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::maxlog2(as()), T); + TTS_EXPR_IS(eve::maxlog2(as()), v_t); +}; +//================================================================================================== +// maxlog2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp2(eve::maxlog2(as())), eve::inf(as())); +}; + +//================================================================================================== +// maxlog2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of maxlog2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp2(eve::maxlog2(as())), eve::inf(as())); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp2(eve::prev(eve::maxlog2(as())))))); + TTS_EXPECT(eve::all(eve::test::is_near(eve::maxlog2[eve::downward](as()), eve::maxlog2[eve::upward](as())))); + TTS_EXPECT(eve::all(eve::is_finite(eve::exp2(eve::prev(eve::maxlog2(as())))))); +}; + + +//================================================================================================== +// simd Tests for masked maxlog2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of maxlog2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::maxlog2[mask](eve::as(a0)), eve::if_else(mask, eve::maxlog2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlog.cpp b/test/unit/module/math/constant/minlog.cpp new file mode 100644 index 0000000000..98caffadeb --- /dev/null +++ b/test/unit/module/math/constant/minlog.cpp @@ -0,0 +1,64 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlog", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlog(as()), T); + TTS_EXPR_IS(eve::minlog(as()), v_t); +}; +//================================================================================================== +// minlog tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::minlog(as())), eve::zero(as())); +}; + +//================================================================================================== +// minlog tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::minlog(as())), eve::zero(as())); +#ifndef SPY_ARCH_IS_ARM + TTS_EXPECT(eve::all(eve::is_gtz(eve::exp(eve::next(eve::minlog(as())))))); +#endif + TTS_EXPECT(eve::all(eve::test::is_near(eve::minlog[eve::downward](as()), eve::minlog[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked minlog +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlog[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlog[mask](eve::as(a0)), eve::if_else(mask, eve::minlog(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlog10.cpp b/test/unit/module/math/constant/minlog10.cpp new file mode 100644 index 0000000000..f01f0528c7 --- /dev/null +++ b/test/unit/module/math/constant/minlog10.cpp @@ -0,0 +1,67 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlog10", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlog10(as()), T); + TTS_EXPR_IS(eve::minlog10(as()), v_t); +}; +//================================================================================================== +// minlog10 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog10 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_IEEE_EQUAL(eve::exp10(eve::minlog10(as())), eve::zero(as())); +}; + +//================================================================================================== +// minlog10 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog10 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::is_gtz(eve::exp10(eve::next(eve::minlog10(as())))))); + TTS_EXPECT(eve::all(eve::test::is_near(eve::minlog10[eve::downward](as()), eve::minlog10[eve::upward](as())))); + TTS_EXPECT(eve::all(eve::is_gtz(eve::exp10(eve::next(eve::minlog10(as())))))); + TTS_EXPECT(eve::all(eve::is_eqz(eve::exp10(eve::minlog10(as()))))); +}; + + +//================================================================================================== +// simd Tests for masked minlog10 +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlog10[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlog10[mask](eve::as(a0)), eve::if_else(mask, eve::minlog10(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlog10denormal.cpp b/test/unit/module/math/constant/minlog10denormal.cpp new file mode 100644 index 0000000000..b87108fed3 --- /dev/null +++ b/test/unit/module/math/constant/minlog10denormal.cpp @@ -0,0 +1,65 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlog10denormal", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlog10denormal(as()), T); + TTS_EXPR_IS(eve::minlog10denormal(as()), v_t); +}; +//================================================================================================== +// minlog10denormal tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog10denormal on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + if constexpr( eve::platform::supports_denormals ) + TTS_EXPECT(eve::all(eve::is_gtz(eve::pedantic(eve::exp10)(eve::next(eve::minlog10denormal(as())))))); + TTS_IEEE_EQUAL(eve::pedantic(eve::exp10)(eve::minlog10denormal(as())), eve::zero(as())); + +}; + +//================================================================================================== +// minlog10denormal tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog10denormal on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + if constexpr( eve::platform::supports_denormals ) + TTS_EXPECT(eve::all(eve::is_gtz(eve::pedantic(eve::exp10)(eve::next(eve::minlog10denormal(as())))))); + TTS_IEEE_EQUAL(eve::exp10(eve::minlog10denormal(as())), eve::zero(as())); +}; + + +//================================================================================================== +// simd Tests for masked minlog10denormal +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlog10denormal[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlog10denormal[mask](eve::as(a0)), eve::if_else(mask, eve::minlog10denormal(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlog2.cpp b/test/unit/module/math/constant/minlog2.cpp new file mode 100644 index 0000000000..9ccc022dce --- /dev/null +++ b/test/unit/module/math/constant/minlog2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlog2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlog2(as()), T); + TTS_EXPR_IS(eve::minlog2(as()), v_t); +}; +//================================================================================================== +// minlog2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp2(eve::minlog2(as())), eve::zero(as())); +}; + +//================================================================================================== +// minlog2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp2(eve::minlog2(as())), eve::zero(as())); +#ifndef SPY_ARCH_IS_ARM + TTS_EXPECT(eve::all(eve::is_gtz(eve::exp2(eve::next(eve::minlog2(as())))))); +#endif +}; + + +//================================================================================================== +// simd Tests for masked minlog2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlog2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlog2[mask](eve::as(a0)), eve::if_else(mask, eve::minlog2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlog2denormal.cpp b/test/unit/module/math/constant/minlog2denormal.cpp new file mode 100644 index 0000000000..112f0fb302 --- /dev/null +++ b/test/unit/module/math/constant/minlog2denormal.cpp @@ -0,0 +1,62 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlog2denormal", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlog2denormal(as()), T); + TTS_EXPR_IS(eve::minlog2denormal(as()), v_t); +}; +//================================================================================================== +// minlog2denormal tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog2denormal on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp2(eve::minlog2denormal(as())), eve::zero(as())); +}; + +//================================================================================================== +// minlog2denormal tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlog2denormal on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::pedantic(eve::exp2)(eve::minlog2denormal(as())), eve::zero(as())); + if constexpr( eve::platform::supports_denormals ) + TTS_EXPECT(eve::all(eve::is_gtz(eve::pedantic(eve::exp2)(eve::next(eve::minlog2denormal(as())))))); +}; + + +//================================================================================================== +// simd Tests for masked minlog2denormal +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlog2denormal[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlog2denormal[mask](eve::as(a0)), eve::if_else(mask, eve::minlog2denormal(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/minlogdenormal.cpp b/test/unit/module/math/constant/minlogdenormal.cpp new file mode 100644 index 0000000000..793dedc1db --- /dev/null +++ b/test/unit/module/math/constant/minlogdenormal.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of minlogdenormal", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::minlogdenormal(as()), T); + TTS_EXPR_IS(eve::minlogdenormal(as()), v_t); +}; +//================================================================================================== +// minlogdenormal tests on scalar on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlogdenormal on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::minlogdenormal(as())), eve::zero(as())); +}; + + +//================================================================================================== +// minlogdenormal tests on wide on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of minlogdenormal on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_IEEE_EQUAL(eve::exp(eve::minlogdenormal(as())), eve::zero(as())); + if constexpr( eve::platform::supports_denormals ) + TTS_EXPECT(eve::all(eve::is_gtz(eve::pedantic(eve::exp)(eve::next(eve::minlogdenormal(as())))))); +}; + + +//================================================================================================== +// simd Tests for masked minlogdenormal +//================================================================================================== +TTS_CASE_WITH("Check behavior of minlogdenormal[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::minlogdenormal[mask](eve::as(a0)), eve::if_else(mask, eve::minlogdenormal(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/phi.cpp b/test/unit/module/math/constant/phi.cpp new file mode 100644 index 0000000000..11af5e630e --- /dev/null +++ b/test/unit/module/math/constant/phi.cpp @@ -0,0 +1,68 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of phi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::phi(as()), T); + TTS_EXPR_IS(eve::phi(as()), v_t); +}; +//================================================================================================== +// phi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of phi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + TTS_IEEE_EQUAL(eve::phi(as()), T(1.61803398874989484820458683436563811772030917980575l)); + TTS_EXPECT(eve::all(eve::phi[eve::downward](as()) <= eve::phi(as()))); + TTS_EXPECT(eve::all(eve::phi(as()) <= eve::phi[eve::upward](as()))); + TTS_ULP_EQUAL(eve::phi[eve::downward](as()), eve::phi[eve::upward](as()), 0.5); +}; + +//================================================================================================== +// phi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of phi on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::phi[eve::downward](as()), eve::phi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked phi +//================================================================================================== +TTS_CASE_WITH("Check behavior of phi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::phi[mask](eve::as(a0)), eve::if_else(mask, eve::phi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi.cpp b/test/unit/module/math/constant/pi.cpp new file mode 100644 index 0000000000..d2f14eb41c --- /dev/null +++ b/test/unit/module/math/constant/pi.cpp @@ -0,0 +1,69 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi(as()), T); + TTS_EXPR_IS(eve::pi(as()), v_t); +}; +//================================================================================================== +// pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::pi[eve::downward](as()) < 4 * std::atan(1.0l)); + TTS_EXPECT(eve::pi[eve::upward](as()) > 4 * std::atan(1.0l)); + } + TTS_EQUAL(eve::pi(as()), T(4 * std::atan(1.0l))); +}; + +//================================================================================================== +// pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::pi[eve::downward](as())), eve::pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi[mask](eve::as(a0)), eve::if_else(mask, eve::pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi2.cpp b/test/unit/module/math/constant/pi2.cpp new file mode 100644 index 0000000000..73098c654d --- /dev/null +++ b/test/unit/module/math/constant/pi2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi2(as()), T); + TTS_EXPR_IS(eve::pi2(as()), v_t); +}; +//================================================================================================== +// pi2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi2[eve::downward](eve::as()) <= 3.141592653589793238462643l*3.141592653589793238462643l); + TTS_EXPECT(eve::pi2[eve::upward](eve::as()) >= 3.141592653589793238462643l*3.141592653589793238462643l); + } + TTS_EQUAL(eve::pi2(eve::as()), T(3.141592653589793238462643l*3.141592653589793238462643l)); +}; + +//================================================================================================== +// pi2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi2[eve::downward](as()), eve::pi2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi2[mask](eve::as(a0)), eve::if_else(mask, eve::pi2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi2o_16.cpp b/test/unit/module/math/constant/pi2o_16.cpp new file mode 100644 index 0000000000..bf8cc30708 --- /dev/null +++ b/test/unit/module/math/constant/pi2o_16.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi2o_16 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi2o_16", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi2o_16(as()), T); + TTS_EXPR_IS(eve::pi2o_16(as()), v_t); +}; +//================================================================================================== +// pi2o_16 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2o_16 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi2o_16[eve::downward](eve::as()) <= 3.141592653589793238462643l*3.141592653589793238462643l/16); + TTS_EXPECT(eve::pi2o_16[eve::upward](eve::as()) >= 3.141592653589793238462643l*3.141592653589793238462643l/16); + } + TTS_EQUAL(eve::pi2o_16(eve::as()), T(3.141592653589793238462643l*3.141592653589793238462643l/16)); +}; + +//================================================================================================== +// pi2o_16 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2o_16 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi2o_16[eve::downward](as()), eve::pi2o_16[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi2o_16 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi2o_16[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi2o_16[mask](eve::as(a0)), eve::if_else(mask, eve::pi2o_16(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi2o_6.cpp b/test/unit/module/math/constant/pi2o_6.cpp new file mode 100644 index 0000000000..1abe2a0d25 --- /dev/null +++ b/test/unit/module/math/constant/pi2o_6.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi2o_6 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi2o_6", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi2o_6(as()), T); + TTS_EXPR_IS(eve::pi2o_6(as()), v_t); +}; +//================================================================================================== +// pi2o_6 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2o_6 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi2o_6[eve::downward](eve::as()) <= 3.141592653589793238462643l*3.141592653589793238462643l/6); + TTS_EXPECT(eve::pi2o_6[eve::upward](eve::as()) >= 3.141592653589793238462643l*3.141592653589793238462643l/6); + } + TTS_EQUAL(eve::pi2o_6(eve::as()), T(3.141592653589793238462643l*3.141592653589793238462643l/6)); +}; + +//================================================================================================== +// pi2o_6 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi2o_6 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi2o_6[eve::downward](as()), eve::pi2o_6[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi2o_6 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi2o_6[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi2o_6[mask](eve::as(a0)), eve::if_else(mask, eve::pi2o_6(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi3.cpp b/test/unit/module/math/constant/pi3.cpp new file mode 100644 index 0000000000..4b50e8cb7a --- /dev/null +++ b/test/unit/module/math/constant/pi3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi3(as()), T); + TTS_EXPR_IS(eve::pi3(as()), v_t); +}; +//================================================================================================== +// pi3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi3[eve::downward](eve::as()) <= 3.141592653589793238462643l*3.141592653589793238462643l*3.141592653589793238462643l); + TTS_EXPECT(eve::pi3[eve::upward](eve::as()) >= 3.141592653589793238462643l*3.141592653589793238462643l*3.141592653589793238462643l); + } + TTS_ULP_EQUAL(eve::pi3(eve::as()), T(3.141592653589793238462643l*3.141592653589793238462643l*3.141592653589793238462643l), 0.5); +}; + +//================================================================================================== +// pi3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi3[eve::downward](as()), eve::pi3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi3[mask](eve::as(a0)), eve::if_else(mask, eve::pi3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi_minus_3.cpp b/test/unit/module/math/constant/pi_minus_3.cpp new file mode 100644 index 0000000000..c66ad22b29 --- /dev/null +++ b/test/unit/module/math/constant/pi_minus_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi_minus_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi_minus_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi_minus_3(as()), T); + TTS_EXPR_IS(eve::pi_minus_3(as()), v_t); +}; +//================================================================================================== +// pi_minus_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi_minus_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi_minus_3[eve::downward](eve::as()) <= 3.141592653589793238462643l-3); + TTS_EXPECT(eve::pi_minus_3[eve::upward](eve::as()) >= 3.141592653589793238462643l-3); + } + TTS_ULP_EQUAL(eve::pi_minus_3(eve::as()), T(3.141592653589793238462643l-3), 2.0); +}; + +//================================================================================================== +// pi_minus_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi_minus_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi_minus_3[eve::downward](as()), eve::pi_minus_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi_minus_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi_minus_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi_minus_3[mask](eve::as(a0)), eve::if_else(mask, eve::pi_minus_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pi_pow_e.cpp b/test/unit/module/math/constant/pi_pow_e.cpp new file mode 100644 index 0000000000..1ed143828e --- /dev/null +++ b/test/unit/module/math/constant/pi_pow_e.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pi_pow_e Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pi_pow_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pi_pow_e(as()), T); + TTS_EXPR_IS(eve::pi_pow_e(as()), v_t); +}; +//================================================================================================== +// pi_pow_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi_pow_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pi_pow_e[eve::downward](eve::as()) <= std::pow(3.141592653589793238462643l,std::exp(1.0l))); + TTS_EXPECT(eve::pi_pow_e[eve::upward](eve::as()) >= std::pow(3.141592653589793238462643l,std::exp(1.0l))); + } + TTS_ULP_EQUAL(eve::pi_pow_e(eve::as()), T(std::pow(3.141592653589793238462643l,std::exp(1.0l))), 0.5); +}; + +//================================================================================================== +// pi_pow_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pi_pow_e on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pi_pow_e[eve::downward](as()), eve::pi_pow_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pi_pow_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of pi_pow_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pi_pow_e[mask](eve::as(a0)), eve::if_else(mask, eve::pi_pow_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pio_2.cpp b/test/unit/module/math/constant/pio_2.cpp new file mode 100644 index 0000000000..f408ea4d91 --- /dev/null +++ b/test/unit/module/math/constant/pio_2.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pio_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pio_2(as()), T); + TTS_EXPR_IS(eve::pio_2(as()), v_t); +}; +//================================================================================================== +// pio_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::pio_2[eve::downward](as()) < 2 * std::atan(1.0l)); + TTS_EXPECT(eve::pio_2[eve::upward](as()) > 2 * std::atan(1.0l)); + } + TTS_EQUAL(eve::pio_2(as()), T(2 * std::atan(1.0l))); +}; + +//================================================================================================== +// pio_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_2 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::pio_2[eve::downward](as())), eve::pio_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pio_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pio_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pio_2[mask](eve::as(a0)), eve::if_else(mask, eve::pio_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pio_3.cpp b/test/unit/module/math/constant/pio_3.cpp new file mode 100644 index 0000000000..084368d35a --- /dev/null +++ b/test/unit/module/math/constant/pio_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pio_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pio_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pio_3(as()), T); + TTS_EXPR_IS(eve::pio_3(as()), v_t); +}; +//================================================================================================== +// pio_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pio_3[eve::downward](eve::as()) <= 3.141592653589793238462643l/3); + TTS_EXPECT(eve::pio_3[eve::upward](eve::as()) >= 3.141592653589793238462643l/3); + } + TTS_ULP_EQUAL(eve::pio_3(eve::as()), T(3.141592653589793238462643l/3), 0.5); +}; + +//================================================================================================== +// pio_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pio_3[eve::downward](as()), eve::pio_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pio_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pio_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pio_3[mask](eve::as(a0)), eve::if_else(mask, eve::pio_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pio_4.cpp b/test/unit/module/math/constant/pio_4.cpp new file mode 100644 index 0000000000..ebc287819f --- /dev/null +++ b/test/unit/module/math/constant/pio_4.cpp @@ -0,0 +1,70 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pio_4", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pio_4(as()), T); + TTS_EXPR_IS(eve::pio_4(as()), v_t); +}; +//================================================================================================== +// pio_4 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_4 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::pio_4[eve::downward](as()) < std::atan(1.0l)); + TTS_EXPECT(eve::pio_4[eve::upward](as()) > std::atan(1.0l)); + } + TTS_EQUAL(eve::pio_4(as()), T(std::atan(1.0l))); +}; + +//================================================================================================== +// pio_4 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_4 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::pio_4[eve::downward](as())), eve::pio_4[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pio_4 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pio_4[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pio_4[mask](eve::as(a0)), eve::if_else(mask, eve::pio_4(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/pio_6.cpp b/test/unit/module/math/constant/pio_6.cpp new file mode 100644 index 0000000000..0faca5929e --- /dev/null +++ b/test/unit/module/math/constant/pio_6.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// pio_6 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of pio_6", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::pio_6(as()), T); + TTS_EXPR_IS(eve::pio_6(as()), v_t); +}; +//================================================================================================== +// pio_6 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_6 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::pio_6[eve::downward](eve::as()) <= 3.141592653589793238462643l/6); + TTS_EXPECT(eve::pio_6[eve::upward](eve::as()) >= 3.141592653589793238462643l/6); + } + TTS_ULP_EQUAL(eve::pio_6(eve::as()), T(3.141592653589793238462643l/6), 0.5); +}; + +//================================================================================================== +// pio_6 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of pio_6 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::pio_6[eve::downward](as()), eve::pio_6[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked pio_6 +//================================================================================================== +TTS_CASE_WITH("Check behavior of pio_6[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::pio_6[mask](eve::as(a0)), eve::if_else(mask, eve::pio_6(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/quarter.cpp b/test/unit/module/math/constant/quarter.cpp new file mode 100644 index 0000000000..0c11e80c4a --- /dev/null +++ b/test/unit/module/math/constant/quarter.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// quarter Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of quarter", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::quarter(as()), T); + TTS_EXPR_IS(eve::quarter(as()), v_t); +}; +//================================================================================================== +// quarter tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of quarter on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::quarter[eve::downward](eve::as()) <= 0.25l); + TTS_EXPECT(eve::quarter[eve::upward](eve::as()) >= 0.25l); + } + TTS_EQUAL(eve::quarter(eve::as()), T(0.25l)); +}; + +//================================================================================================== +// quarter tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of quarter on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::quarter[eve::downward](as()), eve::quarter[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked quarter +//================================================================================================== +TTS_CASE_WITH("Check behavior of quarter[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::quarter[mask](eve::as(a0)), eve::if_else(mask, eve::quarter(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/rsqrt_2pi.cpp b/test/unit/module/math/constant/rsqrt_2pi.cpp new file mode 100644 index 0000000000..5ff591b290 --- /dev/null +++ b/test/unit/module/math/constant/rsqrt_2pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// rsqrt_2pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of rsqrt_2pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::rsqrt_2pi(as()), T); + TTS_EXPR_IS(eve::rsqrt_2pi(as()), v_t); +}; +//================================================================================================== +// rsqrt_2pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_2pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::rsqrt_2pi[eve::downward](eve::as()) <= 1.0l/std::sqrt(2*3.141592653589793238462643l)); + TTS_EXPECT(eve::rsqrt_2pi[eve::upward](eve::as()) >= 1.0l/std::sqrt(2*3.141592653589793238462643l)); + } + TTS_EQUAL(eve::rsqrt_2pi(eve::as()), T(1.0l/std::sqrt(2*3.141592653589793238462643l))); +}; + +//================================================================================================== +// rsqrt_2pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_2pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::rsqrt_2pi[eve::downward](as()), eve::rsqrt_2pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked rsqrt_2pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of rsqrt_2pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::rsqrt_2pi[mask](eve::as(a0)), eve::if_else(mask, eve::rsqrt_2pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/rsqrt_e.cpp b/test/unit/module/math/constant/rsqrt_e.cpp new file mode 100644 index 0000000000..bce5f4b2df --- /dev/null +++ b/test/unit/module/math/constant/rsqrt_e.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// rsqrt_e Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of rsqrt_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::rsqrt_e(as()), T); + TTS_EXPR_IS(eve::rsqrt_e(as()), v_t); +}; +//================================================================================================== +// rsqrt_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::rsqrt_e[eve::downward](eve::as()) <= std::exp(-0.5l)); + TTS_EXPECT(eve::rsqrt_e[eve::upward](eve::as()) >= std::exp(-0.5l)); + } + TTS_EQUAL(eve::rsqrt_e(eve::as()), T(std::exp(-0.5l))); +}; + +//================================================================================================== +// rsqrt_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_e on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::rsqrt_e[eve::downward](as()), eve::rsqrt_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked rsqrt_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of rsqrt_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::rsqrt_e[mask](eve::as(a0)), eve::if_else(mask, eve::rsqrt_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/rsqrt_pi.cpp b/test/unit/module/math/constant/rsqrt_pi.cpp similarity index 52% rename from test/unit/module/math/rsqrt_pi.cpp rename to test/unit/module/math/constant/rsqrt_pi.cpp index dd6219c46b..620c79e9b8 100644 --- a/test/unit/module/math/rsqrt_pi.cpp +++ b/test/unit/module/math/constant/rsqrt_pi.cpp @@ -24,11 +24,10 @@ TTS_CASE_TPL("Check return types of rsqrt_pi", eve::test::simd::ieee_reals) TTS_EXPR_IS(eve::rsqrt_pi(as()), T); TTS_EXPR_IS(eve::rsqrt_pi(as()), v_t); }; - //================================================================================================== -// e tests +// e tests on scalar //================================================================================================== -TTS_CASE_TPL("Check behavior of e on wide", eve::test::simd::ieee_reals) +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::scalar::ieee_reals) (tts::type) { using eve::as; @@ -37,13 +36,36 @@ TTS_CASE_TPL("Check behavior of e on wide", eve::test::simd::ieee_reals) using elt_t = eve::element_type_t; if constexpr( sizeof(long double) > sizeof(elt_t) ) { - TTS_EXPECT(downward(eve::rsqrt_pi)(as()) + TTS_EXPECT(eve::rsqrt_pi[eve::downward](as()) < 0.564189583547756286948079451560772585844050629329l); - TTS_EXPECT(upward(eve::rsqrt_pi)(as()) + TTS_EXPECT(eve::rsqrt_pi[eve::upward](as()) > 0.564189583547756286948079451560772585844050629329l); } TTS_EQUAL(eve::rsqrt_pi(as()), T(0.564189583547756286948079451560772585844050629329l)); - TTS_EXPECT(eve::all(downward(eve::rsqrt_pi)(as()) <= eve::rsqrt_pi(as()))); - TTS_EXPECT(eve::all(eve::rsqrt_pi(as()) <= upward(eve::rsqrt_pi)(as()))); - TTS_ULP_EQUAL(downward(eve::rsqrt_pi)(as()), upward(eve::rsqrt_pi)(as()), 0.5); +}; + +//================================================================================================== +// e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::rsqrt_pi[eve::downward](as())), eve::rsqrt_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked rsqrt_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of rsqrt_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::rsqrt_pi[mask](eve::as(a0)), eve::if_else(mask, eve::rsqrt_pi(eve::as(a0)), eve::zero)); }; diff --git a/test/unit/module/math/constant/rsqrt_pio_2.cpp b/test/unit/module/math/constant/rsqrt_pio_2.cpp new file mode 100644 index 0000000000..f097878524 --- /dev/null +++ b/test/unit/module/math/constant/rsqrt_pio_2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// rsqrt_pio_2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of rsqrt_pio_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::rsqrt_pio_2(as()), T); + TTS_EXPR_IS(eve::rsqrt_pio_2(as()), v_t); +}; +//================================================================================================== +// rsqrt_pio_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_pio_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::rsqrt_pio_2[eve::downward](eve::as()) <= 1.0l/std::sqrt(3.141592653589793238462643l/2)); + TTS_EXPECT(eve::rsqrt_pio_2[eve::upward](eve::as()) >= 1.0l/std::sqrt(3.141592653589793238462643l/2)); + } + TTS_EQUAL(eve::rsqrt_pio_2(eve::as()), T(1.0l/std::sqrt(3.141592653589793238462643l/2))); +}; + +//================================================================================================== +// rsqrt_pio_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of rsqrt_pio_2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::rsqrt_pio_2[eve::downward](as()), eve::rsqrt_pio_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked rsqrt_pio_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of rsqrt_pio_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::rsqrt_pio_2[mask](eve::as(a0)), eve::if_else(mask, eve::rsqrt_pio_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sin_1.cpp b/test/unit/module/math/constant/sin_1.cpp new file mode 100644 index 0000000000..1f7ba35154 --- /dev/null +++ b/test/unit/module/math/constant/sin_1.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sin_1 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sin_1", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sin_1(as()), T); + TTS_EXPR_IS(eve::sin_1(as()), v_t); +}; +//================================================================================================== +// sin_1 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sin_1 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sin_1[eve::downward](eve::as()) <= std::sin(1.0l)); + TTS_EXPECT(eve::sin_1[eve::upward](eve::as()) >= std::sin(1.0l)); + } + TTS_EQUAL(eve::sin_1(eve::as()), T(std::sin(1.0l))); +}; + +//================================================================================================== +// sin_1 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sin_1 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sin_1[eve::downward](as()), eve::sin_1[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sin_1 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sin_1[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sin_1[mask](eve::as(a0)), eve::if_else(mask, eve::sin_1(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sinh_1.cpp b/test/unit/module/math/constant/sinh_1.cpp new file mode 100644 index 0000000000..e9d6db5e31 --- /dev/null +++ b/test/unit/module/math/constant/sinh_1.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sinh_1 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sinh_1", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sinh_1(as()), T); + TTS_EXPR_IS(eve::sinh_1(as()), v_t); +}; +//================================================================================================== +// sinh_1 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sinh_1 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sinh_1[eve::downward](eve::as()) <= std::sinh(1.0l)); + TTS_EXPECT(eve::sinh_1[eve::upward](eve::as()) >= std::sinh(1.0l)); + } + TTS_EQUAL(eve::sinh_1(eve::as()), T(std::sinh(1.0l))); +}; + +//================================================================================================== +// sinh_1 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sinh_1 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sinh_1[eve::downward](as()), eve::sinh_1[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sinh_1 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sinh_1[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sinh_1[mask](eve::as(a0)), eve::if_else(mask, eve::sinh_1(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sixth.cpp b/test/unit/module/math/constant/sixth.cpp new file mode 100644 index 0000000000..d12af6842e --- /dev/null +++ b/test/unit/module/math/constant/sixth.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sixth Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sixth", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sixth(as()), T); + TTS_EXPR_IS(eve::sixth(as()), v_t); +}; +//================================================================================================== +// sixth tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sixth on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sixth[eve::downward](eve::as()) <= 1.0l/6); + TTS_EXPECT(eve::sixth[eve::upward](eve::as()) >= 1.0l/6); + } + TTS_EQUAL(eve::sixth(eve::as()), T(1.0l/6)); +}; + +//================================================================================================== +// sixth tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sixth on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sixth[eve::downward](as()), eve::sixth[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sixth +//================================================================================================== +TTS_CASE_WITH("Check behavior of sixth[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sixth[mask](eve::as(a0)), eve::if_else(mask, eve::sixth(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_2.cpp b/test/unit/module/math/constant/sqrt_2.cpp new file mode 100644 index 0000000000..32197bb8cb --- /dev/null +++ b/test/unit/module/math/constant/sqrt_2.cpp @@ -0,0 +1,72 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_2(as()), T); + TTS_EXPR_IS(eve::sqrt_2(as()), v_t); +}; +//================================================================================================== +// e tests on scalar on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::rsqrt_pi[eve::downward](as()) + < 0.564189583547756286948079451560772585844050629329l); + TTS_EXPECT(eve::rsqrt_pi[eve::upward](as()) + > 0.564189583547756286948079451560772585844050629329l); + } + TTS_EQUAL(eve::rsqrt_pi(as()), T(0.564189583547756286948079451560772585844050629329l)); +}; + +//================================================================================================== +// e tests on wide on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of e on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrt_2[eve::downward](as()), eve::sqrt_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_2[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_2pi.cpp b/test/unit/module/math/constant/sqrt_2pi.cpp new file mode 100644 index 0000000000..784eee7354 --- /dev/null +++ b/test/unit/module/math/constant/sqrt_2pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sqrt_2pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_2pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_2pi(as()), T); + TTS_EXPR_IS(eve::sqrt_2pi(as()), v_t); +}; +//================================================================================================== +// sqrt_2pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_2pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sqrt_2pi[eve::downward](eve::as()) <= std::sqrt(2*3.141592653589793238462643l)); + TTS_EXPECT(eve::sqrt_2pi[eve::upward](eve::as()) >= std::sqrt(2*3.141592653589793238462643l)); + } + TTS_ULP_EQUAL(eve::sqrt_2pi(eve::as()), T(std::sqrt(2*3.141592653589793238462643l)), 0.5); +}; + +//================================================================================================== +// sqrt_2pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_2pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrt_2pi[eve::downward](as()), eve::sqrt_2pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_2pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_2pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_2pi[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_2pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_3.cpp b/test/unit/module/math/constant/sqrt_3.cpp new file mode 100644 index 0000000000..c4e3660853 --- /dev/null +++ b/test/unit/module/math/constant/sqrt_3.cpp @@ -0,0 +1,73 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_3(as()), T); + TTS_EXPR_IS(eve::sqrt_3(as()), v_t); +}; +//================================================================================================== +// sqrt_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + using elt_t = eve::element_type_t; + if constexpr( sizeof(long double) > sizeof(elt_t) ) + { + TTS_EXPECT(eve::sqrt_3[eve::downward](as()) < std::sqrt(3.0l)); + TTS_EXPECT(eve::sqrt_3[eve::upward](as()) > std::sqrt(3.0l)); + } + TTS_IEEE_EQUAL(eve::sqrt_3(as()), T(std::sqrt(3.0l))); + TTS_EXPECT(eve::all(eve::sqrt_3[eve::downward](as()) <= eve::sqrt_3(as()))); + TTS_EXPECT(eve::all(eve::sqrt_3(as()) <= eve::sqrt_3[eve::upward](as()))); + TTS_ULP_EQUAL(eve::sqrt_3[eve::downward](as()), eve::sqrt_3[eve::upward](as()), 0.5); +}; + +//================================================================================================== +// sqrt_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_3 on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::sqrt_3[eve::downward](as())), eve::sqrt_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_3[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_e.cpp b/test/unit/module/math/constant/sqrt_e.cpp new file mode 100644 index 0000000000..5bc706a7e9 --- /dev/null +++ b/test/unit/module/math/constant/sqrt_e.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sqrt_e Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_e", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_e(as()), T); + TTS_EXPR_IS(eve::sqrt_e(as()), v_t); +}; +//================================================================================================== +// sqrt_e tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_e on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sqrt_e[eve::downward](eve::as()) <= std::exp(0.5l)); + TTS_EXPECT(eve::sqrt_e[eve::upward](eve::as()) >= std::exp(0.5l)); + } + TTS_EQUAL(eve::sqrt_e(eve::as()), T(std::exp(0.5l))); +}; + +//================================================================================================== +// sqrt_e tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_e on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrt_e[eve::downward](as()), eve::sqrt_e[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_e +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_e[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_e[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_e(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_pi.cpp b/test/unit/module/math/constant/sqrt_pi.cpp new file mode 100644 index 0000000000..e46e538620 --- /dev/null +++ b/test/unit/module/math/constant/sqrt_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sqrt_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_pi(as()), T); + TTS_EXPR_IS(eve::sqrt_pi(as()), v_t); +}; +//================================================================================================== +// sqrt_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sqrt_pi[eve::downward](eve::as()) <= std::sqrt(3.141592653589793238462643l)); + TTS_EXPECT(eve::sqrt_pi[eve::upward](eve::as()) >= std::sqrt(3.141592653589793238462643l)); + } + TTS_ULP_EQUAL(eve::sqrt_pi(eve::as()), T(std::sqrt(3.141592653589793238462643l)), 0.5); +}; + +//================================================================================================== +// sqrt_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrt_pi[eve::downward](as()), eve::sqrt_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_pi[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrt_pio_2.cpp b/test/unit/module/math/constant/sqrt_pio_2.cpp new file mode 100644 index 0000000000..e377019d2f --- /dev/null +++ b/test/unit/module/math/constant/sqrt_pio_2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sqrt_pio_2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrt_pio_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrt_pio_2(as()), T); + TTS_EXPR_IS(eve::sqrt_pio_2(as()), v_t); +}; +//================================================================================================== +// sqrt_pio_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_pio_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sqrt_pio_2[eve::downward](eve::as()) <= std::sqrt(3.141592653589793238462643l/2)); + TTS_EXPECT(eve::sqrt_pio_2[eve::upward](eve::as()) >= std::sqrt(3.141592653589793238462643l/2)); + } + TTS_ULP_EQUAL(eve::sqrt_pio_2(eve::as()), T(std::sqrt(3.141592653589793238462643l/2)), 0.5); +}; + +//================================================================================================== +// sqrt_pio_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrt_pio_2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrt_pio_2[eve::downward](as()), eve::sqrt_pio_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrt_pio_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrt_pio_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrt_pio_2[mask](eve::as(a0)), eve::if_else(mask, eve::sqrt_pio_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/sqrtlog_4.cpp b/test/unit/module/math/constant/sqrtlog_4.cpp new file mode 100644 index 0000000000..1d1be9ff41 --- /dev/null +++ b/test/unit/module/math/constant/sqrtlog_4.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// sqrtlog_4 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of sqrtlog_4", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::sqrtlog_4(as()), T); + TTS_EXPR_IS(eve::sqrtlog_4(as()), v_t); +}; +//================================================================================================== +// sqrtlog_4 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrtlog_4 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::sqrtlog_4[eve::downward](eve::as()) <= std::sqrt(std::log(4.0l))); + TTS_EXPECT(eve::sqrtlog_4[eve::upward](eve::as()) >= std::sqrt(std::log(4.0l))); + } + TTS_EQUAL(eve::sqrtlog_4(eve::as()), T(std::sqrt(std::log(4.0l)))); +}; + +//================================================================================================== +// sqrtlog_4 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of sqrtlog_4 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::sqrtlog_4[eve::downward](as()), eve::sqrtlog_4[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked sqrtlog_4 +//================================================================================================== +TTS_CASE_WITH("Check behavior of sqrtlog_4[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::sqrtlog_4[mask](eve::as(a0)), eve::if_else(mask, eve::sqrtlog_4(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/third.cpp b/test/unit/module/math/constant/third.cpp new file mode 100644 index 0000000000..efa7378a6c --- /dev/null +++ b/test/unit/module/math/constant/third.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// third Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of third", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::third(as()), T); + TTS_EXPR_IS(eve::third(as()), v_t); +}; +//================================================================================================== +// third tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of third on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::third[eve::downward](eve::as()) <= 1.0l/3); + TTS_EXPECT(eve::third[eve::upward](eve::as()) >= 1.0l/3); + } + TTS_EQUAL(eve::third(eve::as()), T(1.0l/3)); +}; + +//================================================================================================== +// third tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of third on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::third[eve::downward](as()), eve::third[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked third +//================================================================================================== +TTS_CASE_WITH("Check behavior of third[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::third[mask](eve::as(a0)), eve::if_else(mask, eve::third(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/three_o_4.cpp b/test/unit/module/math/constant/three_o_4.cpp new file mode 100644 index 0000000000..9b84ad2392 --- /dev/null +++ b/test/unit/module/math/constant/three_o_4.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// three_o_4 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of three_o_4", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::three_o_4(as()), T); + TTS_EXPR_IS(eve::three_o_4(as()), v_t); +}; +//================================================================================================== +// three_o_4 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of three_o_4 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::three_o_4[eve::downward](eve::as()) <= 3.0/4); + TTS_EXPECT(eve::three_o_4[eve::upward](eve::as()) >= 3.0/4); + } + TTS_EQUAL(eve::three_o_4(eve::as()), T(3.0/4)); +}; + +//================================================================================================== +// three_o_4 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of three_o_4 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::three_o_4[eve::downward](as()), eve::three_o_4[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked three_o_4 +//================================================================================================== +TTS_CASE_WITH("Check behavior of three_o_4[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::three_o_4[mask](eve::as(a0)), eve::if_else(mask, eve::three_o_4(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/three_pio_4.cpp b/test/unit/module/math/constant/three_pio_4.cpp new file mode 100644 index 0000000000..fcc3abc804 --- /dev/null +++ b/test/unit/module/math/constant/three_pio_4.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// three_pio_4 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of three_pio_4", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::three_pio_4(as()), T); + TTS_EXPR_IS(eve::three_pio_4(as()), v_t); +}; +//================================================================================================== +// three_pio_4 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of three_pio_4 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::three_pio_4[eve::downward](eve::as()) <= 3.0*3.141592653589793238462643l/4); + TTS_EXPECT(eve::three_pio_4[eve::upward](eve::as()) >= 3.0*3.141592653589793238462643l/4); + } + TTS_EQUAL(eve::three_pio_4(eve::as()), T(3.0*3.141592653589793238462643l/4)); +}; + +//================================================================================================== +// three_pio_4 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of three_pio_4 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::three_pio_4[eve::downward](as()), eve::three_pio_4[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked three_pio_4 +//================================================================================================== +TTS_CASE_WITH("Check behavior of three_pio_4[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::three_pio_4[mask](eve::as(a0)), eve::if_else(mask, eve::three_pio_4(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/two_o_3.cpp b/test/unit/module/math/constant/two_o_3.cpp new file mode 100644 index 0000000000..375791ee82 --- /dev/null +++ b/test/unit/module/math/constant/two_o_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// two_o_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of two_o_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::two_o_3(as()), T); + TTS_EXPR_IS(eve::two_o_3(as()), v_t); +}; +//================================================================================================== +// two_o_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::two_o_3[eve::downward](eve::as()) <= 2.0/3); + TTS_EXPECT(eve::two_o_3[eve::upward](eve::as()) >= 2.0/3); + } + TTS_EQUAL(eve::two_o_3(eve::as()), T(2.0/3)); +}; + +//================================================================================================== +// two_o_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::two_o_3[eve::downward](as()), eve::two_o_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked two_o_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of two_o_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::two_o_3[mask](eve::as(a0)), eve::if_else(mask, eve::two_o_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/two_o_pi.cpp b/test/unit/module/math/constant/two_o_pi.cpp new file mode 100644 index 0000000000..bfa21de01c --- /dev/null +++ b/test/unit/module/math/constant/two_o_pi.cpp @@ -0,0 +1,64 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of two_o_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::two_o_pi(as()), T); + TTS_EXPR_IS(eve::two_o_pi(as()), v_t); +}; +//================================================================================================== +// two_o_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + TTS_EQUAL(eve::two_o_pi(as()), T(2) / T(4 * std::atan(1.0l))); +}; + +//================================================================================================== +// two_o_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_pi on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::two_o_pi[eve::downward](as())), eve::two_o_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked two_o_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of two_o_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::two_o_pi[mask](eve::as(a0)), eve::if_else(mask, eve::two_o_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/two_o_sqrt_pi.cpp b/test/unit/module/math/constant/two_o_sqrt_pi.cpp new file mode 100644 index 0000000000..46d5cf6b0f --- /dev/null +++ b/test/unit/module/math/constant/two_o_sqrt_pi.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// two_o_sqrt_pi Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of two_o_sqrt_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::two_o_sqrt_pi(as()), T); + TTS_EXPR_IS(eve::two_o_sqrt_pi(as()), v_t); +}; +//================================================================================================== +// two_o_sqrt_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_sqrt_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::two_o_sqrt_pi[eve::downward](eve::as()) <= 2.0/std::sqrt(3.141592653589793238462643l)); + TTS_EXPECT(eve::two_o_sqrt_pi[eve::upward](eve::as()) >= 2.0/std::sqrt(3.141592653589793238462643l)); + } + TTS_EQUAL(eve::two_o_sqrt_pi(eve::as()), T(2.0/std::sqrt(3.141592653589793238462643l))); +}; + +//================================================================================================== +// two_o_sqrt_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_o_sqrt_pi on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::two_o_sqrt_pi[eve::downward](as()), eve::two_o_sqrt_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked two_o_sqrt_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of two_o_sqrt_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::two_o_sqrt_pi[mask](eve::as(a0)), eve::if_else(mask, eve::two_o_sqrt_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/two_pi.cpp b/test/unit/module/math/constant/two_pi.cpp new file mode 100644 index 0000000000..0d2911486c --- /dev/null +++ b/test/unit/module/math/constant/two_pi.cpp @@ -0,0 +1,64 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of two_pi", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::two_pi(as()), T); + TTS_EXPR_IS(eve::two_pi(as()), v_t); +}; +//================================================================================================== +// two_pi tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_pi on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + + TTS_EQUAL(eve::two_pi(as()), T(8 * std::atan(1.0l))); +}; + +//================================================================================================== +// two_pi tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_pi on scalar", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + using eve::downward; + using eve::upward; + TTS_EXPECT(eve::all(eve::test::is_near(eve::next(eve::two_pi[eve::downward](as())), eve::two_pi[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked two_pi +//================================================================================================== +TTS_CASE_WITH("Check behavior of two_pi[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::two_pi[mask](eve::as(a0)), eve::if_else(mask, eve::two_pi(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/two_pio_3.cpp b/test/unit/module/math/constant/two_pio_3.cpp new file mode 100644 index 0000000000..0cfea53288 --- /dev/null +++ b/test/unit/module/math/constant/two_pio_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// two_pio_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of two_pio_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::two_pio_3(as()), T); + TTS_EXPR_IS(eve::two_pio_3(as()), v_t); +}; +//================================================================================================== +// two_pio_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_pio_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::two_pio_3[eve::downward](eve::as()) <= 2.0*3.141592653589793238462643l/3); + TTS_EXPECT(eve::two_pio_3[eve::upward](eve::as()) >= 2.0*3.141592653589793238462643l/3); + } + TTS_ULP_EQUAL(eve::two_pio_3(eve::as()), T(2.0*3.141592653589793238462643l/3), 0.5); +}; + +//================================================================================================== +// two_pio_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of two_pio_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::two_pio_3[eve::downward](as()), eve::two_pio_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked two_pio_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of two_pio_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::two_pio_3[mask](eve::as(a0)), eve::if_else(mask, eve::two_pio_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/zeta_2.cpp b/test/unit/module/math/constant/zeta_2.cpp new file mode 100644 index 0000000000..010b256d25 --- /dev/null +++ b/test/unit/module/math/constant/zeta_2.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// zeta_2 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of zeta_2", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::zeta_2(as()), T); + TTS_EXPR_IS(eve::zeta_2(as()), v_t); +}; +//================================================================================================== +// zeta_2 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of zeta_2 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::zeta_2[eve::downward](eve::as()) <= 3.141592653589793238462643l*3.141592653589793238462643l/6); + TTS_EXPECT(eve::zeta_2[eve::upward](eve::as()) >= 3.141592653589793238462643l*3.141592653589793238462643l/6); + } + TTS_EQUAL(eve::zeta_2(eve::as()), T(3.141592653589793238462643l*3.141592653589793238462643l/6)); +}; + +//================================================================================================== +// zeta_2 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of zeta_2 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::zeta_2[eve::downward](as()), eve::zeta_2[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked zeta_2 +//================================================================================================== +TTS_CASE_WITH("Check behavior of zeta_2[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::zeta_2[mask](eve::as(a0)), eve::if_else(mask, eve::zeta_2(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/constant/zeta_3.cpp b/test/unit/module/math/constant/zeta_3.cpp new file mode 100644 index 0000000000..fec3a35329 --- /dev/null +++ b/test/unit/module/math/constant/zeta_3.cpp @@ -0,0 +1,63 @@ +//================================================================================================== +/** + EVE - Expressive Vector Engine + Copyright : EVE Project Contributors + SPDX-License-Identifier: BSL-1.0 +**/ +//================================================================================================== +#include "test.hpp" + +#include +#include + +#include + +//================================================================================================== +// zeta_3 Types tests +//================================================================================================== +TTS_CASE_TPL("Check return types of zeta_3", eve::test::simd::ieee_reals) +(tts::type) +{ + using v_t = eve::element_type_t; + using eve::as; + + TTS_EXPR_IS(eve::zeta_3(as()), T); + TTS_EXPR_IS(eve::zeta_3(as()), v_t); +}; +//================================================================================================== +// zeta_3 tests on scalar +//================================================================================================== +TTS_CASE_TPL("Check behavior of zeta_3 on scalar", eve::test::scalar::ieee_reals) +(tts::type) +{ + if constexpr( sizeof(long double) > sizeof(T) ) + { + TTS_EXPECT(eve::zeta_3[eve::downward](eve::as()) <= 1.202056903159594285399738161511449990l); + TTS_EXPECT(eve::zeta_3[eve::upward](eve::as()) >= 1.202056903159594285399738161511449990l); + } + TTS_EQUAL(eve::zeta_3(eve::as()), T(1.202056903159594285399738161511449990l)); +}; + +//================================================================================================== +// zeta_3 tests on wide +//================================================================================================== +TTS_CASE_TPL("Check behavior of zeta_3 on wide", eve::test::simd::ieee_reals) +(tts::type) +{ + using eve::as; + TTS_EXPECT(eve::all(eve::test::is_near(eve::zeta_3[eve::downward](as()), eve::zeta_3[eve::upward](as())))); +}; + + +//================================================================================================== +// simd Tests for masked zeta_3 +//================================================================================================== +TTS_CASE_WITH("Check behavior of zeta_3[mask] on :wide)", + eve::test::simd::ieee_reals, + tts::generate(tts::randoms(eve::valmin, eve::valmax), + tts::logicals(0, 3))) +(T const& a0, + M const& mask) +{ + TTS_IEEE_EQUAL(eve::zeta_3[mask](eve::as(a0)), eve::if_else(mask, eve::zeta_3(eve::as(a0)), eve::zero)); +}; diff --git a/test/unit/module/math/egamma.cpp b/test/unit/module/math/egamma.cpp deleted file mode 100644 index e7fe6042cd..0000000000 --- a/test/unit/module/math/egamma.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of egamma", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::egamma(as()), T); - TTS_EXPR_IS(eve::egamma(as()), v_t); -}; - -//================================================================================================== -// e tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of e on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::egamma)(as()) < 0.57721566490153286060651209008l); - TTS_EXPECT(upward(eve::egamma)(as()) > 0.57721566490153286060651209008l); - } - TTS_EQUAL(eve::egamma(as()), T(0.57721566490153286060651209008l)); - TTS_EXPECT(eve::all(downward(eve::egamma)(as()) <= eve::egamma(as()))); - TTS_EXPECT(eve::all(eve::egamma(as()) <= upward(eve::egamma)(as()))); - TTS_ULP_EQUAL(downward(eve::egamma)(as()), upward(eve::egamma)(as()), 0.5); -}; diff --git a/test/unit/module/math/euler.cpp b/test/unit/module/math/euler.cpp deleted file mode 100644 index 68f5f429bc..0000000000 --- a/test/unit/module/math/euler.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of euler", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::euler(as()), T); - TTS_EXPR_IS(eve::euler(as()), v_t); -}; - -//================================================================================================== -// e tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of e on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::euler)(as()) < std::exp(1.0l)); - TTS_EXPECT(upward(eve::euler)(as()) > std::exp(1.0l)); - } - TTS_EQUAL(eve::euler(as()), T(std::exp(1.0l))); - TTS_EXPECT(eve::all(downward(eve::euler)(as()) <= eve::euler(as()))); - TTS_EXPECT(eve::all(eve::euler(as()) <= upward(eve::euler)(as()))); - TTS_ULP_EQUAL(downward(eve::euler)(as()), upward(eve::euler)(as()), 0.5); -}; diff --git a/test/unit/module/math/exp.cpp b/test/unit/module/math/exp.cpp index 3dce7cebbc..207dfffa1e 100644 --- a/test/unit/module/math/exp.cpp +++ b/test/unit/module/math/exp.cpp @@ -91,13 +91,13 @@ TTS_CASE_TPL("Check return types of exp", eve::test::simd::ieee_reals) //================================================================================================== -// Tests for masked exp +// Tests for masked exp //================================================================================================== TTS_CASE_WITH("Check behavior of eve::masked(eve::exp)(eve::wide)", eve::test::simd::ieee_reals, tts::generate(tts::randoms(eve::valmin, eve::valmax), tts::logicals(0, 3))) -(T const& a0, +(T const& a0, M const& mask) { TTS_IEEE_EQUAL(eve::exp[mask](a0), diff --git a/test/unit/module/math/exp10.cpp b/test/unit/module/math/exp10.cpp index 92466b7e20..df99ec0354 100644 --- a/test/unit/module/math/exp10.cpp +++ b/test/unit/module/math/exp10.cpp @@ -13,7 +13,7 @@ #include //================================================================================================== -// Types tests +// Types tests //================================================================================================== TTS_CASE_TPL("Check return types of exp10", eve::test::simd::ieee_reals) (tts::type) @@ -25,7 +25,7 @@ TTS_CASE_TPL("Check return types of exp10", eve::test::simd::ieee_reals) }; //================================================================================================== -// exp10 tests +// exp10 tests //================================================================================================== TTS_CASE_WITH("Check behavior of exp10 on wide", eve::test::simd::ieee_reals, @@ -35,8 +35,7 @@ TTS_CASE_WITH("Check behavior of exp10 on wide", using eve::detail::map; using v_t = eve::element_type_t; long double l10 = std::log(10.0l); - TTS_ULP_EQUAL(eve::exp10(a0), map([l10](auto e) -> v_t { return std::exp(l10 * e); }, a0), 380); - TTS_ULP_EQUAL(eve::exp10(a1), map([l10](auto e) -> v_t { return std::exp(l10 * e); }, a1), 2); + TTS_ULP_EQUAL(eve::exp10(a0), map([l10](auto e) -> v_t { return std::exp(l10 * e); }, a0), 380) << "a0 " << a0 << '\n'; TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(a0), map([l10](auto e) -> v_t { return std::exp(l10 * e); }, a0), @@ -65,7 +64,6 @@ TTS_CASE_TPL("Check corner-cases of exp10", eve::test::simd::ieee_reals) TTS_IEEE_EQUAL(eve::pedantic(eve::exp10)(eve::minf(eve::as())), (T(0))); } - TTS_ULP_EQUAL(eve::exp10(T(-1)), T(0.1), 0.5); TTS_IEEE_EQUAL(eve::exp10(T(-0.)), T(1)); TTS_ULP_EQUAL(eve::exp10(eve::minlog10(eve::as())), T(0), 0); TTS_ULP_EQUAL(eve::exp10(eve::prev(eve::minlog10(eve::as()))), T(0), 0); @@ -74,30 +72,30 @@ TTS_CASE_TPL("Check corner-cases of exp10", eve::test::simd::ieee_reals) TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(T(-1)), T(0.1), 0.5); TTS_IEEE_EQUAL(eve::pedantic(eve::exp10)(T(-0.)), T(1)); - if constexpr( eve::platform::supports_denormals ) + if constexpr( eve::platform::supports_denormals && std::same_as && eve::cardinal_v == 1) { TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(eve::minlog10(eve::as())), T(std::exp(elt_t(std::log(10.0)) * eve::minlog10(eve::as()))), - 256); + 256) << + std::hexfloat << eve::minlog10(eve::as()) << " ==== " << eve::minlog10denormal(eve::as()) << '\n'; TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(eve::prev(eve::minlog10(eve::as()))), T(std::exp(elt_t(std::log(10.0)) * eve::prev(eve::minlog10(eve::as())))), 256); } TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(eve::minlog10denormal(eve::as())), T(0), 0); - TTS_ULP_EQUAL( - eve::pedantic(eve::exp10)(eve::prev(eve::minlog10denormal(eve::as()))), T(0), 0); + TTS_ULP_EQUAL(eve::pedantic(eve::exp10)(eve::prev(eve::minlog10denormal(eve::as()))), T(0), 0); } }; //================================================================================================== -// Tests for masked exp10 +//== Tests for masked exp10 //================================================================================================== TTS_CASE_WITH("Check behavior of eve::masked(eve::exp10)(eve::wide)", eve::test::simd::ieee_reals, tts::generate(tts::randoms(eve::valmin, eve::valmax), tts::logicals(0, 3))) -(T const& a0, +(T const& a0, M const& mask) { TTS_IEEE_EQUAL(eve::exp10[mask](a0), diff --git a/test/unit/module/math/exp2.cpp b/test/unit/module/math/exp2.cpp index 67b929c4b9..b0acc75b74 100644 --- a/test/unit/module/math/exp2.cpp +++ b/test/unit/module/math/exp2.cpp @@ -84,10 +84,10 @@ TTS_CASE_TPL("Check return types of exp2", eve::test::simd::ieee_reals) } TTS_ULP_EQUAL(eve::pedantic(eve::exp2)(eve::minlog2denormal(eve::as())), T(std::exp2(eve::minlog2denormal(eve::as()))), - 0); + 0.5); TTS_ULP_EQUAL(eve::pedantic(eve::exp2)(eve::prev(eve::minlog2denormal(eve::as()))), T(std::exp2(eve::prev(eve::minlog2denormal(eve::as())))), - 0); + 0.5); } }; @@ -150,7 +150,7 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::exp2)(eve::wide)", eve::test::simd::ieee_reals, tts::generate(tts::randoms(eve::valmin, eve::valmax), tts::logicals(0, 3))) -(T const& a0, +(T const& a0, M const& mask) { TTS_IEEE_EQUAL(eve::exp2[mask](a0), diff --git a/test/unit/module/math/invlog_2.cpp b/test/unit/module/math/invlog_2.cpp deleted file mode 100644 index 624c70900c..0000000000 --- a/test/unit/module/math/invlog_2.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of invlog_2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::invlog_2(as()), T); - TTS_EXPR_IS(eve::invlog_2(as()), v_t); -}; - -//================================================================================================== -// invlog_2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of invlog_2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::invlog_2)(as()) - < 1.442695040888963407359924681001892137426645954153l); - TTS_EXPECT(upward(eve::invlog_2)(as()) - > 1.442695040888963407359924681001892137426645954153l); - } - TTS_ULP_EQUAL( - eve::invlog_2(as()), T(1.442695040888963407359924681001892137426645954153l), 0.0); - TTS_EXPECT(eve::all(downward(eve::invlog_2)(as()) <= eve::invlog_2(as()))); - TTS_EXPECT(eve::all(eve::invlog_2(as()) <= upward(eve::invlog_2)(as()))); - TTS_ULP_EQUAL(downward(eve::invlog_2)(as()), upward(eve::invlog_2)(as()), 0.5); -}; diff --git a/test/unit/module/math/invpi.cpp b/test/unit/module/math/invpi.cpp deleted file mode 100644 index a28615eb30..0000000000 --- a/test/unit/module/math/invpi.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of inv_pi", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::inv_pi(as()), T); - TTS_EXPR_IS(eve::inv_pi(as()), v_t); -}; - -//================================================================================================== -// inv_pi tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of inv_pi on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::inv_pi)(as()) <= (1.0 / (4 * std::atan(1.0l)))); - TTS_EXPECT(upward(eve::inv_pi)(as()) >= (1.0 / (4 * std::atan(1.0l)))); - } - TTS_ULP_EQUAL(eve::inv_pi(as()), T(1.0 / (4 * std::atan(1.0l))), 0.0); - TTS_EXPECT(eve::all(downward(eve::inv_pi)(as()) <= eve::inv_pi(as()))); - TTS_EXPECT(eve::all(eve::inv_pi(as()) <= upward(eve::inv_pi)(as()))); - TTS_ULP_EQUAL(downward(eve::inv_pi)(as()), upward(eve::inv_pi)(as()), 0.5); -}; diff --git a/test/unit/module/math/invsqrt_2.cpp b/test/unit/module/math/invsqrt_2.cpp deleted file mode 100644 index 7b13b0109a..0000000000 --- a/test/unit/module/math/invsqrt_2.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of invsqrt_2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::invsqrt_2(as()), T); - TTS_EXPR_IS(eve::invsqrt_2(as()), v_t); -}; - -//================================================================================================== -// invsqrt_2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of invsqrt_2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::invsqrt_2)(as()) <= (1.0l / (std::sqrt(2.0l)))); - TTS_EXPECT(upward(eve::invsqrt_2)(as()) >= (1.0l / (std::sqrt(2.0l)))); - } - TTS_ULP_EQUAL(eve::invsqrt_2(as()), T(1.0l / (std::sqrt(2.0l))), 0.5); - TTS_EXPECT(eve::all(downward(eve::invsqrt_2)(as()) <= eve::invsqrt_2(as()))); - TTS_EXPECT(eve::all(upward(eve::invsqrt_2)(as()) >= eve::invsqrt_2(as()))); - TTS_ULP_EQUAL(downward(eve::invsqrt_2)(as()), upward(eve::invsqrt_2)(as()), 0.5); -}; diff --git a/test/unit/module/math/log10_e.cpp b/test/unit/module/math/log10_e.cpp deleted file mode 100644 index 34c83b2663..0000000000 --- a/test/unit/module/math/log10_e.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of log10_e", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::log10_e(as()), T); - TTS_EXPR_IS(eve::log10_e(as()), v_t); -}; - -//================================================================================================== -// log10_e tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of log10_e on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::log10_e)(as()) < std::log10(std::exp(1.0l))); - TTS_EXPECT(upward(eve::log10_e)(as()) > std::log10(std::exp(1.0l))); - } - TTS_ULP_EQUAL(eve::log10_e(as()), T(std::log10(std::exp(1.0l))), 0.0); - TTS_EXPECT(eve::all(downward(eve::log10_e)(as()) <= eve::log10_e(as()))); - TTS_EXPECT(eve::all(eve::log10_e(as()) <= upward(eve::log10_e)(as()))); - TTS_ULP_EQUAL(downward(eve::log10_e)(as()), upward(eve::log10_e)(as()), 0.5); -}; diff --git a/test/unit/module/math/log2_e.cpp b/test/unit/module/math/log2_e.cpp deleted file mode 100644 index 1cd1e17ea9..0000000000 --- a/test/unit/module/math/log2_e.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of log2_e", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::log2_e(as()), T); - TTS_EXPR_IS(eve::log2_e(as()), v_t); -}; - -//================================================================================================== -// log2_e tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of log2_e on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::log2_e)(as()) < std::log2(std::exp(1.0l))); - TTS_EXPECT(upward(eve::log2_e)(as()) > std::log2(std::exp(1.0l))); - } - TTS_ULP_EQUAL(eve::log2_e(as()), T(std::log2(std::exp(1.0l))), 0.0); - TTS_EXPECT(eve::all(downward(eve::log2_e)(as()) <= eve::log2_e(as()))); - TTS_EXPECT(eve::all(eve::log2_e(as()) <= upward(eve::log2_e)(as()))); - TTS_ULP_EQUAL(downward(eve::log2_e)(as()), upward(eve::log2_e)(as()), 0.5); -}; diff --git a/test/unit/module/math/log_10.cpp b/test/unit/module/math/log_10.cpp deleted file mode 100644 index 0e9de0157b..0000000000 --- a/test/unit/module/math/log_10.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of log_10", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::log_10(as()), T); - TTS_EXPR_IS(eve::log_10(as()), v_t); -}; - -//================================================================================================== -// log_10 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of log_10 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::log_10)(as()) < std::log(10.0l)); - TTS_EXPECT(upward(eve::log_10)(as()) > std::log(10.0l)); - } - TTS_ULP_EQUAL(eve::log_10(as()), T(std::log(10.0l)), 0.0); - TTS_EXPECT(eve::all(downward(eve::log_10)(as()) <= eve::log_10(as()))); - TTS_EXPECT(eve::all(eve::log_10(as()) <= upward(eve::log_10)(as()))); - TTS_ULP_EQUAL(downward(eve::log_10)(as()), upward(eve::log_10)(as()), 0.5); -}; diff --git a/test/unit/module/math/log_2.cpp b/test/unit/module/math/log_2.cpp deleted file mode 100644 index 95883f88dc..0000000000 --- a/test/unit/module/math/log_2.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of log_2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::log_2(as()), T); - TTS_EXPR_IS(eve::log_2(as()), v_t); -}; - -//================================================================================================== -// log_2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of log_2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::log_2)(as()) < std::log(2.0l)); - TTS_EXPECT(upward(eve::log_2)(as()) > std::log(2.0l)); - } - TTS_ULP_EQUAL(eve::log_2(as()), T(std::log(2.0l)), 0.0); - TTS_EXPECT(eve::all(downward(eve::log_2)(as()) <= eve::log_2(as()))); - TTS_EXPECT(eve::all(eve::log_2(as()) <= upward(eve::log_2)(as()))); - TTS_ULP_EQUAL(downward(eve::log_2)(as()), upward(eve::log_2)(as()), 0.5); -}; diff --git a/test/unit/module/math/maxlog.cpp b/test/unit/module/math/maxlog.cpp deleted file mode 100644 index 1dea018f1d..0000000000 --- a/test/unit/module/math/maxlog.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of maxlog", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::maxlog(as()), T); - TTS_EXPR_IS(eve::maxlog(as()), v_t); -}; - -//================================================================================================== -// maxlog tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of maxlog on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp(eve::maxlog(as())), eve::inf(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog(as())))))); -}; diff --git a/test/unit/module/math/maxlog10.cpp b/test/unit/module/math/maxlog10.cpp deleted file mode 100644 index 4828a0252f..0000000000 --- a/test/unit/module/math/maxlog10.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of maxlog10", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::maxlog10(as()), T); - TTS_EXPR_IS(eve::maxlog10(as()), v_t); -}; - -//================================================================================================== -// maxlog10 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of maxlog10 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp10(eve::maxlog10(as())), eve::inf(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::prev(eve::maxlog10(as())))))); -}; diff --git a/test/unit/module/math/maxlog2.cpp b/test/unit/module/math/maxlog2.cpp deleted file mode 100644 index 3f7ff8b35e..0000000000 --- a/test/unit/module/math/maxlog2.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of maxlog2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::maxlog2(as()), T); - TTS_EXPR_IS(eve::maxlog2(as()), v_t); -}; - -//================================================================================================== -// maxlog2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of maxlog2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp2(eve::maxlog2(as())), eve::inf(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_finite(eve::exp2(eve::prev(eve::maxlog2(as())))))); -}; diff --git a/test/unit/module/math/minlog.cpp b/test/unit/module/math/minlog.cpp deleted file mode 100644 index 81a7a9895b..0000000000 --- a/test/unit/module/math/minlog.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlog", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlog(as()), T); - TTS_EXPR_IS(eve::minlog(as()), v_t); -}; - -//================================================================================================== -// minlog tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlog on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp(eve::minlog(as())), eve::zero(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_finite(eve::exp(eve::next(eve::minlog(as())))))); -}; diff --git a/test/unit/module/math/minlog10.cpp b/test/unit/module/math/minlog10.cpp deleted file mode 100644 index 08b2275123..0000000000 --- a/test/unit/module/math/minlog10.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlog10", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlog10(as()), T); - TTS_EXPR_IS(eve::minlog10(as()), v_t); -}; - -//================================================================================================== -// minlog10 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlog10 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp10(eve::minlog10(as())), eve::zero(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_gtz(eve::exp10(eve::next(eve::minlog10(as())))))); -}; diff --git a/test/unit/module/math/minlog10denormal.cpp b/test/unit/module/math/minlog10denormal.cpp deleted file mode 100644 index a1e1b331b6..0000000000 --- a/test/unit/module/math/minlog10denormal.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlog10denormal", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlog10denormal(as()), T); - TTS_EXPR_IS(eve::minlog10denormal(as()), v_t); -}; - -//================================================================================================== -// minlog10denormal tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlog10denormal on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp10(eve::minlog10denormal(as())), eve::zero(as()), 0.0); - if constexpr( eve::platform::supports_denormals ) - TTS_EXPECT(eve::all( - eve::is_gtz(eve::pedantic(eve::exp10)(eve::next(eve::minlog10denormal(as())))))); -}; diff --git a/test/unit/module/math/minlog2.cpp b/test/unit/module/math/minlog2.cpp deleted file mode 100644 index 6ebfb91ca9..0000000000 --- a/test/unit/module/math/minlog2.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlog2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlog2(as()), T); - TTS_EXPR_IS(eve::minlog2(as()), v_t); -}; - -//================================================================================================== -// minlog2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlog2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp2(eve::minlog2(as())), eve::zero(as()), 0.0); - TTS_EXPECT(eve::all(eve::is_finite(eve::exp2(eve::next(eve::minlog2(as())))))); -}; diff --git a/test/unit/module/math/minlog2denormal.cpp b/test/unit/module/math/minlog2denormal.cpp deleted file mode 100644 index b355d34070..0000000000 --- a/test/unit/module/math/minlog2denormal.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlog2denormal", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlog2denormal(as()), T); - TTS_EXPR_IS(eve::minlog2denormal(as()), v_t); -}; - -//================================================================================================== -// minlog2denormal tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlog2denormal on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp2(eve::minlog2denormal(as())), eve::zero(as()), 0.0); - if constexpr( eve::platform::supports_denormals ) - TTS_EXPECT( - eve::all(eve::is_gtz(eve::pedantic(eve::exp2)(eve::next(eve::minlog2denormal(as())))))); -}; diff --git a/test/unit/module/math/minlogdenormal.cpp b/test/unit/module/math/minlogdenormal.cpp deleted file mode 100644 index 430877b970..0000000000 --- a/test/unit/module/math/minlogdenormal.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of minlogdenormal", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::minlogdenormal(as()), T); - TTS_EXPR_IS(eve::minlogdenormal(as()), v_t); -}; - -//================================================================================================== -// minlogdenormal tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of minlogdenormal on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - TTS_ULP_EQUAL(eve::exp(eve::minlogdenormal(as())), eve::zero(as()), 0.0); -}; diff --git a/test/unit/module/math/phi.cpp b/test/unit/module/math/phi.cpp deleted file mode 100644 index e099cb5931..0000000000 --- a/test/unit/module/math/phi.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of phi", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::phi(as()), T); - TTS_EXPR_IS(eve::phi(as()), v_t); -}; - -//================================================================================================== -// phi tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of phi on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::phi)(as()) - < 1.61803398874989484820458683436563811772030917980575l); - TTS_EXPECT(upward(eve::phi)(as()) - > 1.61803398874989484820458683436563811772030917980575l); - } - TTS_ULP_EQUAL(eve::phi(as()), T(1.61803398874989484820458683436563811772030917980575l), 0.0); - TTS_EXPECT(eve::all(downward(eve::phi)(as()) <= eve::phi(as()))); - TTS_EXPECT(eve::all(eve::phi(as()) <= upward(eve::phi)(as()))); - TTS_ULP_EQUAL(downward(eve::phi)(as()), upward(eve::phi)(as()), 0.5); -}; diff --git a/test/unit/module/math/pi.cpp b/test/unit/module/math/pi.cpp deleted file mode 100644 index 1819835451..0000000000 --- a/test/unit/module/math/pi.cpp +++ /dev/null @@ -1,47 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of pi", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::pi(as()), T); - TTS_EXPR_IS(eve::pi(as()), v_t); -}; - -//================================================================================================== -// pi tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of pi on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::pi)(as()) < 4 * std::atan(1.0l)); - TTS_EXPECT(upward(eve::pi)(as()) > 4 * std::atan(1.0l)); - } - TTS_EQUAL(eve::pi(as()), T(4 * std::atan(1.0l))); - TTS_EXPECT(eve::all(downward(eve::pi)(as()) <= eve::pi(as()))); - TTS_EXPECT(eve::all(eve::pi(as()) <= upward(eve::pi)(as()))); - TTS_ULP_EQUAL(downward(eve::pi)(as()), upward(eve::pi)(as()), 0.5); -}; diff --git a/test/unit/module/math/pio_2.cpp b/test/unit/module/math/pio_2.cpp deleted file mode 100644 index 3dd2554c0a..0000000000 --- a/test/unit/module/math/pio_2.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of pio_2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::pio_2(as()), T); - TTS_EXPR_IS(eve::pio_2(as()), v_t); -}; - -//================================================================================================== -// pio_2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of pio_2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::pio_2)(as()) < 2 * std::atan(1.0l)); - TTS_EXPECT(upward(eve::pio_2)(as()) > 2 * std::atan(1.0l)); - } - TTS_EQUAL(eve::pio_2(as()), T(2 * std::atan(1.0l))); - TTS_EXPECT(eve::all(downward(eve::pio_2)(as()) <= eve::pio_2(as()))); - TTS_EXPECT(eve::all(eve::pio_2(as()) <= upward(eve::pio_2)(as()))); - TTS_ULP_EQUAL(downward(eve::pio_2)(as()), upward(eve::pio_2)(as()), 0.5); -}; diff --git a/test/unit/module/math/pio_4.cpp b/test/unit/module/math/pio_4.cpp deleted file mode 100644 index 5e1d98d93b..0000000000 --- a/test/unit/module/math/pio_4.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of pio_4", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::pio_4(as()), T); - TTS_EXPR_IS(eve::pio_4(as()), v_t); -}; - -//================================================================================================== -// pio_4 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of pio_4 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::pio_4)(as()) < std::atan(1.0l)); - TTS_EXPECT(upward(eve::pio_4)(as()) > std::atan(1.0l)); - } - TTS_EQUAL(eve::pio_4(as()), T(std::atan(1.0l))); - TTS_EXPECT(eve::all(downward(eve::pio_4)(as()) <= eve::pio_4(as()))); - TTS_EXPECT(eve::all(eve::pio_4(as()) <= upward(eve::pio_4)(as()))); - TTS_ULP_EQUAL(downward(eve::pio_4)(as()), upward(eve::pio_4)(as()), 0.5); -}; diff --git a/test/unit/module/math/sqrt_2.cpp b/test/unit/module/math/sqrt_2.cpp deleted file mode 100644 index e976d76791..0000000000 --- a/test/unit/module/math/sqrt_2.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of sqrt_2", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::sqrt_2(as()), T); - TTS_EXPR_IS(eve::sqrt_2(as()), v_t); -}; - -//================================================================================================== -// sqrt_2 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of sqrt_2 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::sqrt_2)(as()) < std::sqrt(2.0l)); - TTS_EXPECT(upward(eve::sqrt_2)(as()) > std::sqrt(2.0l)); - } - TTS_ULP_EQUAL(eve::sqrt_2(as()), T(std::sqrt(2.0l)), 0.0); - TTS_EXPECT(eve::all(downward(eve::sqrt_2)(as()) <= eve::sqrt_2(as()))); - TTS_EXPECT(eve::all(eve::sqrt_2(as()) <= upward(eve::sqrt_2)(as()))); - TTS_ULP_EQUAL(downward(eve::sqrt_2)(as()), upward(eve::sqrt_2)(as()), 0.5); -}; diff --git a/test/unit/module/math/sqrt_3.cpp b/test/unit/module/math/sqrt_3.cpp deleted file mode 100644 index 77889371f5..0000000000 --- a/test/unit/module/math/sqrt_3.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of sqrt_3", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::sqrt_3(as()), T); - TTS_EXPR_IS(eve::sqrt_3(as()), v_t); -}; - -//================================================================================================== -// sqrt_3 tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of sqrt_3 on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - using elt_t = eve::element_type_t; - if constexpr( sizeof(long double) > sizeof(elt_t) ) - { - TTS_EXPECT(downward(eve::sqrt_3)(as()) < std::sqrt(3.0l)); - TTS_EXPECT(upward(eve::sqrt_3)(as()) > std::sqrt(3.0l)); - } - TTS_ULP_EQUAL(eve::sqrt_3(as()), T(std::sqrt(3.0l)), 0.0); - TTS_EXPECT(eve::all(downward(eve::sqrt_3)(as()) <= eve::sqrt_3(as()))); - TTS_EXPECT(eve::all(eve::sqrt_3(as()) <= upward(eve::sqrt_3)(as()))); - TTS_ULP_EQUAL(downward(eve::sqrt_3)(as()), upward(eve::sqrt_3)(as()), 0.5); -}; diff --git a/test/unit/module/math/two_o_pi.cpp b/test/unit/module/math/two_o_pi.cpp deleted file mode 100644 index 99b9ab250b..0000000000 --- a/test/unit/module/math/two_o_pi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of two_o_pi", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::two_o_pi(as()), T); - TTS_EXPR_IS(eve::two_o_pi(as()), v_t); -}; - -//================================================================================================== -// two_o_pi tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of two_o_pi on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - TTS_EQUAL(eve::two_o_pi(as()), T(2) / T(4 * std::atan(1.0l))); - TTS_EXPECT(eve::all(downward(eve::two_o_pi)(as()) <= eve::two_o_pi(as()))); - TTS_EXPECT(eve::all(eve::two_o_pi(as()) <= upward(eve::two_o_pi)(as()))); - TTS_ULP_EQUAL(downward(eve::two_o_pi)(as()), upward(eve::two_o_pi)(as()), 0.5); -}; diff --git a/test/unit/module/math/two_pi.cpp b/test/unit/module/math/two_pi.cpp deleted file mode 100644 index 239001bc2f..0000000000 --- a/test/unit/module/math/two_pi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//================================================================================================== -/** - EVE - Expressive Vector Engine - Copyright : EVE Project Contributors - SPDX-License-Identifier: BSL-1.0 -**/ -//================================================================================================== -#include "test.hpp" - -#include -#include - -#include - -//================================================================================================== -// Types tests -//================================================================================================== -TTS_CASE_TPL("Check return types of two_pi", eve::test::simd::ieee_reals) -(tts::type) -{ - using v_t = eve::element_type_t; - using eve::as; - - TTS_EXPR_IS(eve::two_pi(as()), T); - TTS_EXPR_IS(eve::two_pi(as()), v_t); -}; - -//================================================================================================== -// two_pi tests -//================================================================================================== -TTS_CASE_TPL("Check behavior of two_pi on wide", eve::test::simd::ieee_reals) -(tts::type) -{ - using eve::as; - using eve::downward; - using eve::upward; - - TTS_EQUAL(eve::two_pi(as()), T(8 * std::atan(1.0l))); - TTS_EXPECT(eve::all(downward(eve::two_pi)(as()) <= eve::two_pi(as()))); - TTS_EXPECT(eve::all(eve::two_pi(as()) <= upward(eve::two_pi)(as()))); - TTS_ULP_EQUAL(downward(eve::two_pi)(as()), upward(eve::two_pi)(as()), 0.5); -};