Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress ranges #1509

Merged
merged 18 commits into from
Jan 3, 2023
14 changes: 1 addition & 13 deletions benchmarks/module/core/horner/regular/horner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
//==================================================================================================
#include <eve/module/core.hpp>
#include <eve/module/core/detail/generic/poleval.hpp>
#include <eve/module/core/detail/generic/horn.hpp>
#include <eve/wide.hpp>

Expand All @@ -23,16 +22,7 @@ int main()
};
return eve::horner(z, a);
};
auto eve__poleval = []<typename T>(T z) -> T{
constexpr std::array < v_t, 5> a = {
-4.497014141919556E+001,
5.073465654089319E+001,
-2.485774108720340E+001,
7.222973196770240E+000,
-1.544842782180211E+000,
};
return eve::detail::poleval(z, a);
};

auto lmin = EVE_VALUE(-1);
auto lmax = EVE_VALUE(1);
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
Expand Down Expand Up @@ -69,7 +59,5 @@ int main()
run<EVE_TYPE> (EVE_NAME(eve__horn) , xp, eve__horn, arg0);
}
run<EVE_VALUE> (EVE_NAME(eve__horner) , xp, eve__horner, arg0);
run<EVE_VALUE> (EVE_NAME(eve__poleval) , xp, eve__poleval, arg0);
run<EVE_TYPE> (EVE_NAME(eve__horner) , xp, eve__horner, arg0);
run<EVE_TYPE> (EVE_NAME(eve__poleval) , xp, eve__poleval, arg0);
}
13 changes: 0 additions & 13 deletions benchmarks/module/polynomial/horner/regular/horner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
//==================================================================================================
#include <eve/module/core.hpp>
#include <eve/module/core/detail/generic/poleval.hpp>
#include <eve/module/polynomial.hpp>
#include <eve/module/core/detail/generic/horn.hpp>
#include <eve/wide.hpp>
Expand All @@ -24,16 +23,6 @@ int main()
};
return eve::horner(z, a);
};
auto eve__poleval = []<typename T>(T z) -> T{
constexpr std::array < v_t, 5> a = {
-4.497014141919556E+001,
5.073465654089319E+001,
-2.485774108720340E+001,
7.222973196770240E+000,
-1.544842782180211E+000,
};
return eve::detail::poleval(z, a);
};
auto lmin = EVE_VALUE(-1);
auto lmax = EVE_VALUE(1);
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
Expand Down Expand Up @@ -70,7 +59,5 @@ int main()
run<EVE_TYPE> (EVE_NAME(eve__horn) , xp, eve__horn, arg0);
}
run<EVE_VALUE> (EVE_NAME(eve__horner) , xp, eve__horner, arg0);
run<EVE_VALUE> (EVE_NAME(eve__poleval) , xp, eve__poleval, arg0);
run<EVE_TYPE> (EVE_NAME(eve__horner) , xp, eve__horner, arg0);
run<EVE_TYPE> (EVE_NAME(eve__poleval) , xp, eve__poleval, arg0);
}
52 changes: 0 additions & 52 deletions include/eve/module/bessel/detail/evaluate_rational.hpp

This file was deleted.

3 changes: 0 additions & 3 deletions include/eve/module/bessel/detail/kernel_bessel_ij_small.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
#pragma once

#include <eve/detail/kumi.hpp>
#include <eve/module/bessel/detail/evaluate_rational.hpp>
#include <eve/module/bessel/detail/kernel_bessel_jy.hpp>
#include <eve/module/bessel/regular/cyl_bessel_j0.hpp>
#include <eve/module/bessel/regular/cyl_bessel_j1.hpp>
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>
#include <eve/module/special.hpp>

#include <array>

/////////////////////////////////////////////////////////////////////////////////
// These routines are detail of the computation of cylindrical bessel functions
// of the first kind and second kind for integer orders and small x values.
Expand Down
2 changes: 0 additions & 2 deletions include/eve/module/bessel/detail/kernel_bessel_ik.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <eve/module/math.hpp>
#include <eve/module/special.hpp>

#include <array>

// Written originally by Edward Smith-Rowland.
//
// References:
Expand Down
2 changes: 0 additions & 2 deletions include/eve/module/bessel/detail/kernel_bessel_j.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>

#include <array>

/////////////////////////////////////////////////////////////////////////////////
// These routines are detail of the computation of cylindrical bessel functions
// of the first kind and integer orders.
Expand Down
129 changes: 68 additions & 61 deletions include/eve/module/bessel/regular/impl/cyl_bessel_i0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
#pragma once

#include <eve/detail/hz_device.hpp>
#include <eve/module/bessel/detail/evaluate_rational.hpp>
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>

#include <array>

namespace eve::detail
{
Expand All @@ -27,54 +25,58 @@ cyl_bessel_i0_(EVE_SUPPORTS(cpu_), T x) noexcept
{
if constexpr( std::same_as<elt_t, float> )
{
constexpr std::array<elt_t, 9> P = {1.00000003928615375e+00f,
2.49999576572179639e-01f,
2.77785268558399407e-02f,
1.73560257755821695e-03f,
6.96166518788906424e-05f,
1.89645733877137904e-06f,
4.29455004657565361e-08f,
3.90565476357034480e-10f,
1.48095934745267240e-11f};
T a = sqr(x / 2);
return inc(a * reverse_horner(a, P));
using A9 = kumi::result::generate_t<9, elt_t>;
constexpr A9 P = {1.00000003928615375e+00f,
2.49999576572179639e-01f,
2.77785268558399407e-02f,
1.73560257755821695e-03f,
6.96166518788906424e-05f,
1.89645733877137904e-06f,
4.29455004657565361e-08f,
3.90565476357034480e-10f,
1.48095934745267240e-11f};
T a = sqr(x / 2);
return inc(a * reverse_horner(a, P));
}
else
{
constexpr std::array<elt_t, 15> P = {1.00000000000000000e+00,
2.49999999999999909e-01,
2.77777777777782257e-02,
1.73611111111023792e-03,
6.94444444453352521e-05,
1.92901234513219920e-06,
3.93675991102510739e-08,
6.15118672704439289e-10,
7.59407002058973446e-12,
7.59389793369836367e-14,
6.27767773636292611e-16,
4.34709704153272287e-18,
2.63417742690109154e-20,
1.13943037744822825e-22,
9.07926920085624812e-25};
using A15 = kumi::result::generate_t<15, elt_t>;
constexpr A15 P = {1.00000000000000000e+00,
2.49999999999999909e-01,
2.77777777777782257e-02,
1.73611111111023792e-03,
6.94444444453352521e-05,
1.92901234513219920e-06,
3.93675991102510739e-08,
6.15118672704439289e-10,
7.59407002058973446e-12,
7.59389793369836367e-14,
6.27767773636292611e-16,
4.34709704153272287e-18,
2.63417742690109154e-20,
1.13943037744822825e-22,
9.07926920085624812e-25};
T a = sqr(x / 2);
return inc(a * reverse_horner(a, P));
}
};

auto br_medium = [](auto x) // float 50 double 500
{
if constexpr( std::same_as<elt_t, float> )
{
constexpr std::array<elt_t, 5> P = {3.98942651588301770e-01f,
4.98327234176892844e-02f,
2.91866904423115499e-02f,
1.35614940793742178e-02f,
1.31409251787866793e-01f};
return eve::exp(x) * reverse_horner(rec(x), P) * eve::rsqrt(x);
}
else
{
constexpr std::array<elt_t, 22> P = {
if constexpr( std::same_as<elt_t, float> )
{
using A5 = kumi::result::generate_t<5, elt_t>;
constexpr A5 P = {3.98942651588301770e-01f,
4.98327234176892844e-02f,
2.91866904423115499e-02f,
1.35614940793742178e-02f,
1.31409251787866793e-01f};
return eve::exp(x) * reverse_horner(rec(x), P) * eve::rsqrt(x);
}
else
{
using A22 = kumi::result::generate_t<22, elt_t>;
constexpr A22 P = {
3.98942280401425088e-01, 4.98677850604961985e-02, 2.80506233928312623e-02,
2.92211225166047873e-02, 4.44207299493659561e-02, 1.30970574605856719e-01,
-3.35052280231727022e+00, 2.33025711583514727e+02, -1.13366350697172355e+04,
Expand All @@ -83,30 +85,35 @@ cyl_bessel_i0_(EVE_SUPPORTS(cpu_), T x) noexcept
6.76825737854096565e+12, -4.49034849696138065e+13, 2.24155239966958995e+14,
-8.13426467865659318e+14, 2.02391097391687777e+15, -3.08675715295370878e+15,
2.17587543863819074e+15};
return eve::exp(x) * reverse_horner(rec(x), P) * eve::rsqrt(x);
}
};
return eve::exp(x) * reverse_horner(rec(x), P) * eve::rsqrt(x);
}
};

auto br_large = [](auto x)
{
if constexpr( std::same_as<elt_t, float> )
{
constexpr std::array<elt_t, 3> P = {
3.98942391532752700e-01f, 4.98455950638200020e-02f, 2.94835666900682535e-02f};
auto ex = eve::exp(x / 2);
return ex * (ex * reverse_horner(rec(x), P) / eve::sqrt(x));
}
else
{
constexpr std::array<elt_t, 5> P = {3.98942280401432905e-01,
4.98677850491434560e-02,
2.80506308916506102e-02,
2.92179096853915176e-02,
4.53371208762579442e-02};
auto ex = eve::exp(x / 2);
return ex * (ex * reverse_horner(rec(x), P) * eve::rsqrt(x));
}
};
if constexpr( std::same_as<elt_t, float> )
{
using A3 = kumi::result::generate_t<3, elt_t>;
constexpr A3 P = {
3.98942391532752700e-01f
, 4.98455950638200020e-02f
, 2.94835666900682535e-02f}
;
auto ex = eve::exp(x / 2);
return ex * (ex * reverse_horner(rec(x), P) / eve::sqrt(x));
}
else
{
using A5 = kumi::result::generate_t<5, elt_t>;
constexpr A5 P = {3.98942280401432905e-01,
4.98677850491434560e-02,
2.80506308916506102e-02,
2.92179096853915176e-02,
4.53371208762579442e-02};
auto ex = eve::exp(x / 2);
return ex * (ex * reverse_horner(rec(x), P) * eve::rsqrt(x));
}
};

if constexpr( scalar_value<T> )
{
Expand Down
Loading