From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3B544386EC38; Tue, 31 May 2022 11:37:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B544386EC38 From: "dangelog at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug math/29193] sincos produces a different output than sin/cos Date: Tue, 31 May 2022 11:37:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dangelog at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2022 11:37:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29193 --- Comment #5 from Giuseppe D'Angelo --- Hello, In a nutshell, there are a few things crossing each other: 1) `__sin_fma` returns slightly different results than `__sin_avx` or `__sin_sse2`. I don't think that this is a problem at all, but I might be wrong, I just lack the necessary knowledge about what glibc specifically promises here. 2) `sincos` seems to be consistent with `__sin_sse2`, and therefore inconsistent with `__sin_fma`. Is this inconsistency OK? Should it be documented? 3) In general, this opens the question: within the very same "environment" (same process, CPU, libm, fpenv, etc.), is there any guarantee that `sin(x)` always yields the very same result for identical values of `x`? Is `sin(x)` meant to be perfectly reproducible? If yes, should GCC stop turning pairs of `sin(x)` and `cos(x)` calls into one call to `sincos`? --=20 You are receiving this mail because: You are on the CC list for the bug.=