Skip to content

Commit

Permalink
max_term correction
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed Nov 21, 2023
1 parent fe398ee commit 8841b60
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/eve/module/contfrac/impl/lentz.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace eve::detail
concept addable = requires(T a, T b, T c){c = a+b; };

template <typename Gen, typename U>
EVE_FORCEINLINE constexpr auto internal_lentz_b(Gen g, const U& eps, size_t max_terms)
EVE_FORCEINLINE constexpr auto internal_lentz_b(Gen g, size_t max_terms, const U& eps)
noexcept
{
using eve::abs;
Expand All @@ -31,7 +31,7 @@ namespace eve::detail
using r_t = std::decay_t<tmp_t>;
using u_t = underlying_type_t<r_t>;
u_t tiny = 16*smallestposval(as<u_t>()) ;
u_t terminator(eps <= 0 ? eve::eps(as<u_t>()) : u_t(eps));
u_t terminator(eps <= 0 ? 16*eve::eps(as<u_t>()) : u_t(eps));
size_t counter(max_terms);
r_t f{};
if constexpr(pure_pair) f = get<1>(v); else f = v;
Expand Down Expand Up @@ -85,13 +85,13 @@ namespace eve::detail
template <typename Gen, typename U>
EVE_FORCEINLINE auto lentz_b_(EVE_SUPPORTS(cpu_), Gen g, const U& eps) noexcept
{
return internal_lentz_b(g, eps, eve::valmax(as<size_t>()));
return internal_lentz_b(g, eps, 100u);
}

template <typename Gen>
EVE_FORCEINLINE auto lentz_b_(EVE_SUPPORTS(cpu_), Gen g) noexcept
{
return internal_lentz_b(g, -1, eve::valmax(as<size_t>()));
return internal_lentz_b(g, -1, 100u);
}


Expand Down Expand Up @@ -122,7 +122,7 @@ namespace eve::detail
using r_t = std::decay_t<tmp_t>;
using u_t = underlying_type_t<r_t>;
u_t tiny = 16*smallestposval(as<u_t>());
u_t terminator(eps <= 0 ? eve::eps(as<u_t>()) : u_t(eps));
u_t terminator(eps <= 0 ? 16*eve::eps(as<u_t>()) : u_t(eps));
size_t counter(max_terms);
r_t f{};
if constexpr(pure_pair) f = get<1>(v); else f = v;
Expand Down Expand Up @@ -163,12 +163,12 @@ namespace eve::detail
template <typename Gen, typename U>
EVE_FORCEINLINE auto lentz_a_(EVE_SUPPORTS(cpu_), Gen& g, const U& eps) noexcept
{
return internal_lentz_a(g, eps, eve::valmax(as<size_t>()));
return internal_lentz_a(g, eps, 100u);
}

template <typename Gen>
EVE_FORCEINLINE auto lentz_a_(EVE_SUPPORTS(cpu_), Gen& g) noexcept
{
return internal_lentz_a(g, -1, eve::valmax(as<size_t>()));
return internal_lentz_a(g, -1, 100u);
}
}

0 comments on commit 8841b60

Please sign in to comment.