Implementation of TDigest algorithm in C++