So much for "no more code bumps". The optimizer has a bug if the fair time is under 5 seconds. After finding the upper bound, its first guess shouldn't unconditionally be .75*bound and the step size shouldn't unconditionally be bound/8. Those are correct whenever the bound is greater than 5, otherwise the first guess should be bound/2 and the first step size should be bound/4.
So the first while loop of fairtime() should be:
Code:
while(true)
p,q,w = cs(time)
if p<q begin time*=2 end
elseif p>q
if time>5.0
step = time/8
time *= .75
else
step = time/4
time /= 2
end
break
else break end
end
And the same change should be made to teamfairtime().