```
WITH mannWhitneyUTest('two-sided')(1, right) AS pair SELECT roundBankers(pair.1, 16) AS t_stat, roundBankers(pair.2, 16) AS p_value FROM mann_whitney_test



../src/AggregateFunctions/StatCommon.h:17:31: runtime error: inf is outside the range of representable values of type 'const unsigned long'
    #0 0x10fd0950 in double DB::integrateSimpson<DB::MannWhitneyData::getResult(DB::MannWhitneyData::Alternative, bool)::'lambda'(double)>(double, double, DB::MannWhitneyData::getResult(DB::MannWhitneyData::Alternative, bool)::'lambda'(double)&&) obj-x86_64-linux-gnu/../src/AggregateFunctions/StatCommon.h:17:31
    #1 0x10fd5273 in DB::MannWhitneyData::getResult(DB::MannWhitneyData::Alternative, bool) obj-x86_64-linux-gnu/../src/AggregateFunctions/AggregateFunctionMannWhitney.h:89:29
    #2 0x10fd24c5 in DB::AggregateFunctionMannWhitney::insertResultInto(char*, DB::IColumn&, DB::Arena*) const obj-x86_64-linux-gnu/../src/AggregateFunctions/AggregateFunctionMannWhitney.h:233:57
    #3 0x1aac5694 in void DB::Aggregator::insertAggregatesIntoColumns<char*>(char*&, std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn> > >&, DB::Arena*) const obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1041:44
    #4 0x1a98ee8b in DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const::$_1::operator()(std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn> > >&, std::__1::vector<DB::PODArray<char*, 4096ul, Allocator<false, false>, 15ul, 16ul>*, std::__1::allocator<DB::PODArray<char*, 4096ul, Allocator<false, false>, 15ul, 16ul>*> >&, std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn> > >&, bool) const obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1286:17
    #5 0x1a98ee8b in DB::Block DB::Aggregator::prepareBlockAndFill<DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const::$_1&>(DB::AggregatedDataVariants&, bool, unsigned long, DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const::$_1&) const obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1198:5
    #6 0x1a98ee8b in DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1295:19
    #7 0x1bf9253f in DB::ConvertingAggregatedToChunksTransform::initialize() obj-x86_64-linux-gnu/../src/Processors/Transforms/AggregatingTransform.cpp:341:45
    #8 0x1bc57c58 in DB::executeJob(DB::IProcessor*) obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:80:20
    #9 0x1bc57b46 in DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0::operator()() const obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:97:13
    #10 0x1bc57b46 in decltype(std::__1::forward<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(fp)()) std::__1::__invoke<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&) obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3676:1
    #11 0x1bc56493 in std::__1::__function::__policy_func<void ()>::operator()() const obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2221:16
    #12 0x1bc56493 in std::__1::function<void ()>::operator()() const obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2560:12
    #13 0x1bc56493 in DB::PipelineExecutor::executeStepImpl(unsigned long, unsigned long, std::__1::atomic<bool>*) obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:586:17
    #14 0x1bc54d49 in DB::PipelineExecutor::executeSingleThread(unsigned long, unsigned long) obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:474:5
    #15 0x1bc54d49 in DB::PipelineExecutor::executeImpl(unsigned long) obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:813:9
    #16 0x1bc5480a in DB::PipelineExecutor::execute(unsigned long) obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:396:9
    #17 0x1bc67963 in DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) obj-x86_64-linux-gnu/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:80:24
    #18 0x1bc678a6 in DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const obj-x86_64-linux-gnu/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:107:13
    #19 0x1bc678a6 in decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(fp)()) std::__1::__invoke_constexpr<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3682:1
    #20 0x1bc67751 in decltype(auto) std::__1::__apply_tuple_impl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<>) obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1415:1
    #21 0x1bc67751 in decltype(auto) std::__1::apply<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&) obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1424:1
    #22 0x1bc67751 in ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()::operator()() obj-x86_64-linux-gnu/../src/Common/ThreadPool.h:178:13
    #23 0x1bc67751 in decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3676:1
    #24 0xeb52a7e in std::__1::function<void ()>::operator()() const obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2560:12
    #25 0xeb52a7e in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:247:17
    #26 0xeb56a15 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:124:73
    #27 0xeb56a15 in decltype(std::__1::forward<void>(fp)(std::__1::forward<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(fp0)...)) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()&&...) obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3676:1
    #28 0xeb56a15 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:280:5
    #29 0xeb56a15 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:291:5
    #30 0x7f73a45b9608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
    #31 0x7f73a44e0292 in clone /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/AggregateFunctions/StatCommon.h:17:31 in 
2021.04.26 14:17:29.918752 [ 44 ] {} <Trace> BaseDaemon: Received signal -3
2021.04.26 14:17:29.919201 [ 173 ] {} <Fatal> BaseDaemon: ########################################
2021.04.26 14:17:29.919318 [ 173 ] {} <Fatal> BaseDaemon: (version 21.6.1.6691, build id: 369FBCB0377DFC60ED63F3FA39BDBD1A985847E2) (from thread 168) (query_id: da44bc95-9095-4591-b569-6765626060fb) Received signal Unknown signal (-3)
2021.04.26 14:17:29.919366 [ 173 ] {} <Fatal> BaseDaemon: Sanitizer trap.
2021.04.26 14:17:29.919437 [ 173 ] {} <Fatal> BaseDaemon: Stack trace: 0xeb1e925 0xed60ad6 0xeadff16 0xeaed9af 0x10fd0951 0x10fd5274 0x10fd24c6 0x1aac5695 0x1a98ee8c 0x1bf92540 0x1bc57c59 0x1bc57b47 0x1bc56494 0x1bc54d4a 0x1bc5480b 0x1bc67964 0x1bc678a7 0x1bc67752 0xeb52a7f 0xeb56a16 0x7f73a45b9609 0x7f73a44e0293
2021.04.26 14:17:29.940416 [ 173 ] {} <Fatal> BaseDaemon: 0.1. inlined from ./obj-x86_64-linux-gnu/../src/Common/StackTrace.cpp:304: StackTrace::tryCapture()
2021.04.26 14:17:29.940467 [ 173 ] {} <Fatal> BaseDaemon: 0. ../src/Common/StackTrace.cpp:265: StackTrace::StackTrace() @ 0xeb1e925 in /workspace/clickhouse
2021.04.26 14:17:30.000132 [ 117 ] {} <Debug> AsynchronousMetrics: MemoryTracking: was 852.89 MiB, peak 1.14 GiB, will set to 991.90 MiB (RSS), difference: 139.02 MiB
2021.04.26 14:17:30.004673 [ 173 ] {} <Fatal> BaseDaemon: 1. ./obj-x86_64-linux-gnu/../base/daemon/BaseDaemon.cpp:381: sanitizerDeathCallback() @ 0xed60ad6 in /workspace/clickhouse
2021.04.26 14:17:30.966895 [ 173 ] {} <Fatal> BaseDaemon: 2. __sanitizer::Die() @ 0xeadff16 in /workspace/clickhouse
2021.04.26 14:17:31.910802 [ 173 ] {} <Fatal> BaseDaemon: 3. ? @ 0xeaed9af in /workspace/clickhouse
2021.04.26 14:17:32.864741 [ 173 ] {} <Fatal> BaseDaemon: 4. ? @ 0x10fd0951 in /workspace/clickhouse
2021.04.26 14:17:32.884218 [ 173 ] {} <Fatal> BaseDaemon: 5. ./obj-x86_64-linux-gnu/../src/AggregateFunctions/AggregateFunctionMannWhitney.h:75: DB::MannWhitneyData::getResult(DB::MannWhitneyData::Alternative, bool) @ 0x10fd5274 in /workspace/clickhouse
2021.04.26 14:17:32.902600 [ 173 ] {} <Fatal> BaseDaemon: 6. ./obj-x86_64-linux-gnu/../src/AggregateFunctions/AggregateFunctionMannWhitney.h:233: DB::AggregateFunctionMannWhitney::insertResultInto(char*, DB::IColumn&, DB::Arena*) const @ 0x10fd24c6 in /workspace/clickhouse
2021.04.26 14:17:33.142763 [ 173 ] {} <Fatal> BaseDaemon: 7. ./obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1040: void DB::Aggregator::insertAggregatesIntoColumns<char*>(char*&, std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn> > >&, DB::Arena*) const @ 0x1aac5695 in /workspace/clickhouse
2021.04.26 14:17:33.242473 [ 173 ] {} <Fatal> BaseDaemon: 8.1. inlined from ./obj-x86_64-linux-gnu/../src/Interpreters/Aggregator.cpp:1286: operator()
2021.04.26 14:17:33.242520 [ 173 ] {} <Fatal> BaseDaemon: 8.2. inlined from ../src/Interpreters/Aggregator.cpp:1198: DB::Block DB::Aggregator::prepareBlockAndFill<DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const::$_1&>(DB::AggregatedDataVariants&, bool, unsigned long, DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const::$_1&) const
2021.04.26 14:17:33.242544 [ 173 ] {} <Fatal> BaseDaemon: 8. ../src/Interpreters/Aggregator.cpp:1295: DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const @ 0x1a98ee8c in /workspace/clickhouse
2021.04.26 14:17:33.323576 [ 173 ] {} <Fatal> BaseDaemon: 9. ./obj-x86_64-linux-gnu/../src/Processors/Transforms/AggregatingTransform.cpp:344: DB::ConvertingAggregatedToChunksTransform::initialize() @ 0x1bf92540 in /workspace/clickhouse
2021.04.26 14:17:33.407696 [ 173 ] {} <Fatal> BaseDaemon: 10. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:88: DB::executeJob(DB::IProcessor*) @ 0x1bc57c59 in /workspace/clickhouse
2021.04.26 14:17:33.489355 [ 173 ] {} <Fatal> BaseDaemon: 11.1. inlined from ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:100: operator()
2021.04.26 14:17:33.489387 [ 173 ] {} <Fatal> BaseDaemon: 11. ../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(fp)()) std::__1::__invoke<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&) @ 0x1bc57b47 in /workspace/clickhouse
2021.04.26 14:17:33.566714 [ 173 ] {} <Fatal> BaseDaemon: 12.1. inlined from ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:0: std::__1::__function::__policy_func<void ()>::operator()() const
2021.04.26 14:17:33.566748 [ 173 ] {} <Fatal> BaseDaemon: 12.2. inlined from ../contrib/libcxx/include/functional:2560: std::__1::function<void ()>::operator()() const
2021.04.26 14:17:33.566767 [ 173 ] {} <Fatal> BaseDaemon: 12. ../src/Processors/Executors/PipelineExecutor.cpp:586: DB::PipelineExecutor::executeStepImpl(unsigned long, unsigned long, std::__1::atomic<bool>*) @ 0x1bc56494 in /workspace/clickhouse
2021.04.26 14:17:33.639219 [ 173 ] {} <Fatal> BaseDaemon: 13.1. inlined from ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:0: DB::PipelineExecutor::executeSingleThread(unsigned long, unsigned long)
2021.04.26 14:17:33.639251 [ 173 ] {} <Fatal> BaseDaemon: 13. ../src/Processors/Executors/PipelineExecutor.cpp:813: DB::PipelineExecutor::executeImpl(unsigned long) @ 0x1bc54d4a in /workspace/clickhouse
2021.04.26 14:17:33.716788 [ 173 ] {} <Fatal> BaseDaemon: 14. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:399: DB::PipelineExecutor::execute(unsigned long) @ 0x1bc5480b in /workspace/clickhouse
2021.04.26 14:17:33.758149 [ 173 ] {} <Fatal> BaseDaemon: 15. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:0: DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x1bc67964 in /workspace/clickhouse
2021.04.26 14:17:33.798973 [ 173 ] {} <Fatal> BaseDaemon: 16. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3682: decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(fp)()) std::__1::__invoke_constexpr<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) @ 0x1bc678a7 in /workspace/clickhouse
2021.04.26 14:17:33.839670 [ 173 ] {} <Fatal> BaseDaemon: 17.1. inlined from ./obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:0: operator()
2021.04.26 14:17:33.839723 [ 173 ] {} <Fatal> BaseDaemon: 17. ../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) @ 0x1bc67752 in /workspace/clickhouse
2021.04.26 14:17:33.854946 [ 173 ] {} <Fatal> BaseDaemon: 18.1. inlined from ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2533: std::__1::function<void ()>::operator=(std::nullptr_t)
2021.04.26 14:17:33.854975 [ 173 ] {} <Fatal> BaseDaemon: 18. ../src/Common/ThreadPool.cpp:250: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xeb52a7f in /workspace/clickhouse
2021.04.26 14:17:33.871589 [ 173 ] {} <Fatal> BaseDaemon: 19. ./obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:0: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) @ 0xeb56a16 in /workspace/clickhouse
2021.04.26 14:17:33.871643 [ 173 ] {} <Fatal> BaseDaemon: 20. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.04.26 14:17:33.871685 [ 173 ] {} <Fatal> BaseDaemon: 21. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.04.26 14:17:34.144984 [ 173 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: DC91F9F49D6B830373FE1E8D537C970D. There is no information about the reference checksum.
```


https://clickhouse-test-reports.s3.yandex.net/23554/5d101336ffa3a323d1de9ab2216c13ec3d2e0628/fuzzer_ubsan/report.html#fail1
{
    const size_t iterations = std::max(1e6, 1e4 * std::abs(std::round(b) - std::round(a)));
    const long double h = (b - a) / iterations;
    Float64 sum_odds = 0.0;
    for (size_t i = 1; i < iterations; i += 2)
        sum_odds += func(a + i * h);
    Float64 sum_evens = 0.0;
    for (size_t i = 2; i < iterations; i += 2)
        sum_evens += func(a + i * h);
    return (func(a) + func(b) + 2 * sum_evens + 4 * sum_odds) * h / 3;
}
using RanksArray = std::vector<Float64>;
template <typename Values>
std::pair<RanksArray, Float64> computeRanksAndTieCorrection(const Values & values)
{
    const size_t size = values.size();
    
    std::vector<size_t> indexes(size);
    std::iota(indexes.begin(), indexes.end(), 0);
    std::sort(indexes.begin(), indexes.end(),
                [&] (size_t lhs, size_t rhs) { return values[lhs] < values[rhs]; });
    size_t left = 0;
    Float64 tie_numenator = 0;
    RanksArray out(size);
    while (left < size)