[optim] inline all the functions
[optim] inline the t1 and t2 arrays
[optim] inline the state/seed
[cleanup] make comments more meaningful