Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260819195342.GF23438@brightrain.aerifal.cx>
Date: Wed, 19 Aug 2026 15:53:43 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com, Sergey Davidoff <shnatsel@...il.com>
Subject: Re: [PATCH v4 2/2] math: fmaf rewrite

On Wed, Aug 19, 2026 at 05:28:28PM +0200, Szabolcs Nagy wrote:
> +	double xy = (double)x * y;
> +	union {double r; uint64_t i;} u = {xy + z};
> +	int e = u.i>>52 & 0x7ff;
> +	/* covers |r| > 0x1p-126 halfway cases (may round incorrectly) */
> +	int halfway = (u.i & 0x1fffffff) == 0x10000000;
> +	/* covers tiny inexact (may miss uflow) and tiny halfway cases */
> +	int tiny = e <= 0x3ff-126 && e >= 0x3ff-149;
> +	if (!halfway && !tiny)

Shouldn't this just be:

	if ((!halfway && !tiny) || e == 0x7ff)

so that the rest of the function doesn't have to be conditional? Or am
I missing something?

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.