aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/041-batches/costs/probes.aup
blob: 3255d501b6c732053037c9a469270c99dfa0ca82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
record Cell {
  at = 0
  v = 0
}
state out = 0
input go = message {
  n: u32
}
on go {
  let h: list of Cell by at
  for i in 0 .. go.n {
    h.add(Cell { at: i * 7919 - floor(i * 7919 / 100003) * 100003 + 5000000, v: i })
  }
  let total = 0
  for o in 0 .. go.n * 10 {
    total = total + h[(o - floor(o / go.n) * go.n) * 7919 - floor((o - floor(o / go.n) * go.n) * 7919 / 100003) * 100003 + 5000000].v
  }
  out = total
}