**Use case**
Clickhouse version 21.4
```
SELECT
    quantileTiming(0.95)(key) AS timing,
    quantileExact(0.95)(key) AS exact,
    quantileTDigest(0.95)(key) AS tdigest
FROM
(
    SELECT
        9000 AS key,
        2 AS count
    UNION ALL
    SELECT
        3000,
        11
    UNION ALL
    SELECT
        1000,
        26
)
ARRAY JOIN range(count) AS s

Query id: addce63f-0b75-46e2-b896-712d66711fb0

┌─timing─┬─exact─┬──tdigest─┐
│   9000 │  9000 │ 8123.076 │
└────────┴───────┴──────────┘


SELECT
    quantileTiming(0.9)(key) AS timing,
    quantileExact(0.9)(key) AS exact,
    quantileTDigest(0.9)(key) AS tdigest
FROM
(
    SELECT key
    FROM
    (
        SELECT
            9000 AS key,
            2 AS count
        UNION ALL
        SELECT
            3000,
            11
        UNION ALL
        SELECT
            1000,
            26
    )
    ARRAY JOIN range(count) AS s
    ORDER BY key ASC
)

Query id: e92e3d07-3b97-4155-aa10-9a15544d9312

┌─timing─┬─exact─┬───tdigest─┐
│   3000 │  3000 │ 6323.0757 │
└────────┴───────┴───────────┘

```

Probably related: https://github.com/tdunning/t-digest/issues/154
/** The algorithm was implemented by Alexei Borzenkov https://github.com/snaury
  * He owns the authorship of the code and half the comments in this namespace,
  * except for merging, serialization, and sorting, as well as selecting types and other changes.
  * We thank Alexei Borzenkov for writing the original code.
  */
/** Implementation of t-digest algorithm (https://github.com/tdunning/t-digest).
  * This option is very similar to MergingDigest on java, however the decision about
  * the union is accepted based on the original condition from the article
  * (via a size constraint, using the approximation of the quantile of each
  * centroid, not the distance on the curve of the position of their boundaries). MergingDigest
  * on java gives significantly fewer centroids than this variant, that
  * negatively affects accuracy with the same compression factor, but gives
  * size guarantees. The author himself on the proposal for this variant said that
  * the size of the digest grows like O(log(n)), while the version on java
  * does not depend on the expected number of points. Also an variant on java
  * uses asin, which slows down the algorithm a bit.
  */
template <typename T>
class QuantileTDigest
{
    using Value = Float32;
    using Count = Float32;
    using BetterFloat = Float64; 
    /** The centroid stores the weight of points around their mean value
      */
    struct Centroid
    {
        Value mean;
        Count count;
        Centroid() = default;