You could simplify things by cribbing from the Hacker's Diet (https://www.fourmilab.ch/hackdiet/) and using an exponentially weighted moving average as your filter. 10% of today's weight + 90% yesterday's EWMA. That's almost a one-liner in awk or perl, or a simple function in bash.
Copilot suggests: awk 'BEGIN{alpha=0.1} NF>=2 { date=$1; w=$2; if (NR==1) ewma=w; else ewma=alpha*w + (1-alpha)*ewma; printf "%s\t%g\t%.6f\n", date, w, ewma }' input.txt
hilti•1h ago