test accumulate algorithm from STL