[impl] special sum function w/ tail recursion