As @snleee has pointed out, the current implementation for covar is not numerical stable and may subject to https://en.wikipedia.org/wiki/Catastrophic_cancellation if the covariance value itself is small. See: https://github.com/apache/pinot/pull/9910 and https://github.com/trinodb/trino/blob/1866a23e3b0377144c1820de892c0de2762351a8/core/trino-main/src/main/java/io/trino/operator/aggregation/state/CovarianceState.java
As @snleee has pointed out, the current implementation for covar is not numerical stable and may subject to https://en.wikipedia.org/wiki/Catastrophic_cancellation if the covariance value itself is small.
See: #9910 and https://github.com/trinodb/trino/blob/1866a23e3b0377144c1820de892c0de2762351a8/core/trino-main/src/main/java/io/trino/operator/aggregation/state/CovarianceState.java