agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Cc: feasiblechart@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19615: COVAR_POP / COVAR_SAMP / REGR_SXY return 0.0 instead of NaN
Date: Tue, 11 Aug 2026 11:56:39 -0400
Message-ID: <2395189.1786463799@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB8bMiu6BYW2TfQPaVs759e+Sf6UpZ_Ag60TfuDi57npfcY-yg@mail.gmail.com>
References: <19615-c7e390593416f6b6@postgresql.org>
	<CAB8bMiu6BYW2TfQPaVs759e+Sf6UpZ_Ag60TfuDi57npfcY-yg@mail.gmail.com>

Andrey Rachitskiy <pl0h0yp1@gmail.com> writes:
> With a constant X and Inf arriving later in Y, commonX stays finite,
> so that update is skipped and Sxy remains 0.  Before the commit, Sxy
> was always updated.  With constant X, tmpX is ~0, so the product
> 0*Inf (or a tiny roundoff times Inf) produced NaN under IEEE rules.
> Inf in the first row still yields NaN, because the older first-input
> path from 33dd9bb3b0a is intact and forces Sxy to NaN up front.
> The new short-circuit never got the matching Inf/NaN handling.

Yeah, I just arrived at pretty much the same conclusion.  We get
Inf/NaN handling right for Sxx and Syy, but not for the cross-product
Sxy.

			regards, tom lane






view thread (4+ messages)  latest in thread

Message-ID: <2395189.1786463799@sss.pgh.pa.us>
Permalink:  ../2395189.1786463799@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2395189.1786463799@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pl0h0yp1@gmail.com, feasiblechart@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19615: COVAR_POP / COVAR_SAMP / REGR_SXY return 0.0 instead of NaN
  In-Reply-To: <2395189.1786463799@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox