From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 3EBC62AAE2 for ; Sun, 11 Aug 2024 22:08:25 +0200 (CEST) Received: (qmail 15794 invoked by uid 550); 11 Aug 2024 20:08:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 15759 invoked from network); 11 Aug 2024 20:08:20 -0000 Date: Sun, 11 Aug 2024 22:08:12 +0200 From: Szabolcs Nagy To: Damian McGuckin Cc: MUSL Message-ID: <20240811200812.GZ3766212@port70.net> Mail-Followup-To: Damian McGuckin , MUSL References: <21ca5c9-b1e-71b5-87b-a37f81f691ab@esi.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21ca5c9-b1e-71b5-87b-a37f81f691ab@esi.com.au> Subject: Re: [musl] catan(z) * Damian McGuckin [2024-08-12 00:01:01 +1000]: > > In this routine, there are 2 lines of code > > t = 0.5 * atan2(2.0 * x, a); > w = _redupi(t); > > The first computes atan2() which returns a number in the range [-pi,+pi] > which means that t is a number in the range [-pi/2,+pi/2]. > > As far as I understand, the routine _redupi(t) accepts a argument and > reduces it into the range [-pi, +pi]. Am I mistaken? *reduces into [-pi/2, pi/2] > > If I am not wrong, and 't' is already in the range that _redupi(t) will > return, then _redupi() just returns its argument (within a rounding error). > So it seems like a no-op to me. > > Can anybody comment? it only changes the endpoints (t=+-pi/2 case) otherwise no-op i dont know if we care about the endpoints but even if we do there are better ways to fix them up i think _redupi can be removed, nice catch. > > The routine is originally from Moshier's Cephes library. I have Moshier's > book but I cannot find any hints there. > > Thanks - Damian