**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
{
        if (centroids.empty())
        {
            for (size_t result_num = 0; result_num < size; ++result_num)
                result[result_num] = std::is_floating_point_v<ResultType> ? NAN : 0;
            return;
        }
        compress();
        if (centroids.size() == 1)
        {
            for (size_t result_num = 0; result_num < size; ++result_num)
                result[result_num] = centroids.front().mean;
            return;
        }
        Float64 x = levels[levels_permutation[0]] * count;
        Float64 prev_x = 0;
        Count sum = 0;
        Value prev_mean = centroids.front().mean;
        size_t result_num = 0;
        for (const auto & c : centroids)
        {
            Float64 current_x = sum + c.count * 0.5;
            while (current_x >= x)
            {
                result[levels_permutation[result_num]] = interpolate(x, prev_x, prev_mean, current_x, c.mean);
                ++result_num;
                if (result_num >= size)