def sq_sum.go

mlbend-metrics@0.1.0.0 · main.bend:126

import mlbend-metrics@0.1.0.0/main.bend as MlbendMetrics
import Base

126# the sum of the squared differences of the pairs walked
127def sq_sum.go(ys: List<&2, F32>, ps: List<&2, F32>, acc: Sum) -> Sum:
128  match ys ps:
129    case Con{y, yt} Con{p, pt}:
130      +d = (y - p : F32);
131      sum_add(sq_sum.go(yt, pt, acc), (d * d : F32))
132    case _ _:
133      acc

Uses (6)

Used by (2)