**Describe the bug**
[A link to the report
](https://s3.amazonaws.com/clickhouse-test-reports/42413/1a9d190788e4e9db7e1bb367d57b50719621e9a0/fuzzer_astfuzzerasan//report.html)

**How to reproduce**
```sql
DROP TABLE IF EXISTS welch_ttest__fuzz_7;
CREATE TABLE welch_ttest__fuzz_7 (left UInt128, right UInt128) ENGINE = Memory;

INSERT INTO welch_ttest__fuzz_7 VALUES (0.010268, 0), (0.000167, 0), (0.000167, 0), (0.159258, 1), (0.136278, 1), (0.122389, 1);

SET send_logs_level = 'error';

SELECT roundBankers(welchTTest(left, right).2, 6) from welch_ttest__fuzz_7;

```

```
2022.10.18 12:47:31.372017 [ 2770 ] {0542a2f4-9087-401d-bec6-d5818856f3c7} <Error> executeQuery: std::exception. Code: 1001, type: boost::wrapexcept<std::domain_error>, e.what() = Error in function boost::math::students_t_distribution<double>::students_t_distribution: Degrees of freedom argument is -nan, but must be > 0 ! (version 22.10.1.1) (from [::ffff:127.0.0.1]:41524) (in query: SELECT roundBankers(welchTTest(left, right).2, 6) from welch_ttest__fuzz_7;), Stack trace (when copying this message, always include the lines below):

0. ./build_clang/./contrib/libcxx/include/exception:133: std::logic_error::logic_error(std::logic_error const&) @ 0x1a6576f0 in /usr/local/bin/clickhouse
1. boost::wrapexcept<std::domain_error>::wrapexcept(std::domain_error const&) @ 0xe737654 in /usr/local/bin/clickhouse
2. void boost::throw_exception<std::domain_error>(std::domain_error const&) @ 0xe7375ff in /usr/local/bin/clickhouse
3. void boost::math::policies::detail::raise_error<std::domain_error, double>(char const*, char const*, double const&) @ 0xe739c7d in /usr/local/bin/clickhouse
4. ./build_clang/./contrib/boost/boost/math/policies/error_handling.hpp:0: DB::AggregateFunctionTTest<DB::(anonymous namespace)::WelchTTestData>::insertResultInto(char*, DB::IColumn&, DB::Arena*) const @ 0x122fdee3 in /usr/local/bin/clickhouse
5. ./build_clang/./src/Interpreters/Aggregator.cpp:1817: 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 @ 0x1487ca2d in /usr/local/bin/clickhouse
6. ./build_clang/./src/Interpreters/Aggregator.cpp:2167: DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const @ 0x147fa6cb in /usr/local/bin/clickhouse
7. ./build_clang/./src/Processors/Transforms/AggregatingTransform.cpp:0: DB::ConvertingAggregatedToChunksTransform::initialize() @ 0x15f3ef87 in /usr/local/bin/clickhouse
8. ./build_clang/./src/Processors/Executors/ExecutionThreadContext.cpp:47: DB::ExecutionThreadContext::executeTask() @ 0x15dc2e9d in /usr/local/bin/clickhouse
9. ./build_clang/./src/Processors/Executors/PipelineExecutor.cpp:228: DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) @ 0x15db9830 in /usr/local/bin/clickhouse
10. ./build_clang/./src/Processors/Executors/PipelineExecutor.cpp:0: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PipelineExecutor::spawnThreads()::$_0>(DB::PipelineExecutor::spawnThreads()::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x15dbaa71 in /usr/local/bin/clickhouse
11. ./build_clang/./base/base/../base/wide_integer_impl.h:772: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x102a8e21 in /usr/local/bin/clickhouse
12. ./build_clang/./contrib/libcxx/include/__memory/unique_ptr.h:312: 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>, bool)::'lambda0'()> >(void*) @ 0x102abe6e in /usr/local/bin/clickhouse
13. ? @ 0x7f4febd6e609 in ?
14. __clone @ 0x7f4febc93163 in ?


0 rows in set. Elapsed: 0.003 sec. 

Received exception from server (version 22.10.1):
Code: 1001. DB::Exception: Received from localhost:9000. DB::Exception: boost::wrapexcept<std::domain_error>: Error in function boost::math::students_t_distribution<double>::students_t_distribution: Degrees of freedom argument is -nan, but must be > 0 !. (STD_EXCEPTION)
```

{
        Float64 mean_x = getMeanX();
        Float64 mean_y = getMeanY();
        Float64 sx2 = (x2 + nx * mean_x * mean_x - 2 * mean_x * x1) / (nx - 1);
        Float64 sy2 = (y2 + ny * mean_y * mean_y - 2 * mean_y * y1) / (ny - 1);
        Float64 numerator_sqrt = sx2 / nx + sy2 / ny;
        Float64 numerator = numerator_sqrt * numerator_sqrt;
        Float64 denominator_x = sx2 * sx2 / (nx * nx * (nx - 1));
        Float64 denominator_y = sy2 * sy2 / (ny * ny * (ny - 1));
        return numerator / (denominator_x + denominator_y);
    }
    std::tuple<Float64, Float64> getResult() const
    {
        Float64 mean_x = getMeanX();
        Float64 mean_y = getMeanY();
        
        Float64 se = getStandardError();
        Float64 t_stat = (mean_x - mean_y) / se;
        auto students_t_distribution = boost::math::students_t_distribution<Float64>(getDegreesOfFreedom());
        Float64 pvalue = 0;
        if (t_stat > 0)
            pvalue = 2 * boost::math::cdf<Float64>(students_t_distribution, -t_stat);
        else
            pvalue = 2 * boost::math::cdf<Float64>(students_t_distribution, t_stat);
        return {t_stat, pvalue};
    }
};
AggregateFunctionPtr createAggregateFunctionWelchTTest(