From 8841b604577c64b8f277eab1f0411327c409b20a Mon Sep 17 00:00:00 2001 From: jtlap Date: Tue, 21 Nov 2023 22:23:17 +0100 Subject: [PATCH] max_term correction --- include/eve/module/contfrac/impl/lentz.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/eve/module/contfrac/impl/lentz.hpp b/include/eve/module/contfrac/impl/lentz.hpp index b288c02c14..fadd57a44b 100644 --- a/include/eve/module/contfrac/impl/lentz.hpp +++ b/include/eve/module/contfrac/impl/lentz.hpp @@ -21,7 +21,7 @@ namespace eve::detail concept addable = requires(T a, T b, T c){c = a+b; }; template - 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; @@ -31,7 +31,7 @@ namespace eve::detail using r_t = std::decay_t; using u_t = underlying_type_t; u_t tiny = 16*smallestposval(as()) ; - u_t terminator(eps <= 0 ? eve::eps(as()) : u_t(eps)); + u_t terminator(eps <= 0 ? 16*eve::eps(as()) : u_t(eps)); size_t counter(max_terms); r_t f{}; if constexpr(pure_pair) f = get<1>(v); else f = v; @@ -85,13 +85,13 @@ namespace eve::detail template EVE_FORCEINLINE auto lentz_b_(EVE_SUPPORTS(cpu_), Gen g, const U& eps) noexcept { - return internal_lentz_b(g, eps, eve::valmax(as())); + return internal_lentz_b(g, eps, 100u); } template EVE_FORCEINLINE auto lentz_b_(EVE_SUPPORTS(cpu_), Gen g) noexcept { - return internal_lentz_b(g, -1, eve::valmax(as())); + return internal_lentz_b(g, -1, 100u); } @@ -122,7 +122,7 @@ namespace eve::detail using r_t = std::decay_t; using u_t = underlying_type_t; u_t tiny = 16*smallestposval(as()); - u_t terminator(eps <= 0 ? eve::eps(as()) : u_t(eps)); + u_t terminator(eps <= 0 ? 16*eve::eps(as()) : u_t(eps)); size_t counter(max_terms); r_t f{}; if constexpr(pure_pair) f = get<1>(v); else f = v; @@ -163,12 +163,12 @@ namespace eve::detail template EVE_FORCEINLINE auto lentz_a_(EVE_SUPPORTS(cpu_), Gen& g, const U& eps) noexcept { - return internal_lentz_a(g, eps, eve::valmax(as())); + return internal_lentz_a(g, eps, 100u); } template EVE_FORCEINLINE auto lentz_a_(EVE_SUPPORTS(cpu_), Gen& g) noexcept { - return internal_lentz_a(g, -1, eve::valmax(as())); + return internal_lentz_a(g, -1, 100u); } }