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.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE 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 74F0126664 for ; Sat, 9 Mar 2024 21:23:33 +0100 (CET) Received: (qmail 3926 invoked by uid 550); 9 Mar 2024 20:19:27 -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 3894 invoked from network); 9 Mar 2024 20:19:27 -0000 Date: Sat, 9 Mar 2024 21:23:19 +0100 From: Szabolcs Nagy To: Damian McGuckin Cc: MUSL Message-ID: <20240309202319.GE1884416@port70.net> Mail-Followup-To: Damian McGuckin , MUSL References: <7e3d7940-60c8-2df9-2441-7acee57d7ba@esi.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] Re: cacosh.c - Comment needs correction * Damian McGuckin [2024-03-08 15:44:32 +1100]: > On Fri, 8 Mar 2024, Damian McGuckin wrote: > > > > > The routine produces the correct answer. > > > > However, currently, the comment at the top says > > > > /* acosh(z) = i acos(z) */ > > > > I believe this is technically wrong; > > > > To reflect the code, it should be changed to something like: > > > > /* cacosh(z) = acosh(x +/- i y) = +/- i acos(x + i y) */ > > Sorry (fat fingers or worse): > > /* cacosh(z) = acosh(x +/- i y) = +/- i acos(x +/- i y) */ > according to section 6.2 of https://cs.uwaterloo.ca/~smwatt/pub/reprints/2000-sigsam-according.pdf acosh(z) = +-i acos(z) with + when Im(z)>0 or Im(z)==0 && Re(z)<=1 i guess the Im(z)==+0 && Re(z)>1 case is tricky with ieee -0.0 as it depends on if sqrt(-z) is i or -i for z=1, which depends on if pure reals are treated specially sqrt(-1)==i or as sqrt(-1-0i)==-i, in the latter case the current code looks right to me, just the comment wrong. > Thanks - Damian > > Pacific Engineering Systems International ..... 20D Grose St, Glebe NSW 2037 > Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here > Views & opinions here are mine and not those of any past or present employer