aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/041-batches/costs/recur4.aup
blob: 53e465003177ed86f8eca8ba522d956720c57c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
state out = 0
input go = message {
  n: u32
}
on go {
  let x = 1
  let total = 0
  for i in 0 .. go.n * 1000 {
    x = x * 48271 - floor(x * 48271 / 2147483647) * 2147483647
    total = total + ((x - floor(x / 1000) * 1000) + (x - floor(x / 7) * 7))
  }
  out = total + x
}