From 7baddcabc223e0224b60d2f84a8428d73d5265e4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 17 Nov 2024 09:23:51 -0500 Subject: [PATCH] =?UTF-8?q?Better=20sum=20versus=20runs=20test=20for=20/?= =?UTF-8?q?=E2=81=BC:=20account=20for=20per-element=20cost=20of=20run-base?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/singeli/src/count.singeli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/singeli/src/count.singeli b/src/singeli/src/count.singeli index 7f23fa9e..9201a047 100644 --- a/src/singeli/src/count.singeli +++ b/src/singeli/src/count.singeli @@ -46,7 +46,7 @@ fn count{T if T<=i16}(tab:*u16, ov:*u16, xp:*void, n:u64, min_allowed:T) : T = { # Fast cases dt := promote{u64, fold_addw{dc}} nc := uT~~(mt - jt) # Number of counts to perform: last is implicit - if (dt < b * (vec/2) and dt*8 < b * promote{u64,nc}) { + if (dt < b * (vec/2) and (b + dt)*4 < b * promote{u64,nc}) { r0 = count_with_runs{x, tab, r} } else if (nc <= 24*vbits/128) { r0 = rv