From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13985 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Damian McGuckin Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: atanhf(x) Slight Accuracy Improvements Date: Mon, 18 Mar 2019 10:46:20 +1100 (AEDT) Message-ID: References: <20190317230729.GQ26605@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="130309"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) To: musl@lists.openwall.com Original-X-From: musl-return-14001-gllmg-musl=m.gmane.org@lists.openwall.com Mon Mar 18 00:46:42 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1h5fUF-000Xl9-B5 for gllmg-musl@m.gmane.org; Mon, 18 Mar 2019 00:46:39 +0100 Original-Received: (qmail 26117 invoked by uid 550); 17 Mar 2019 23:46:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26097 invoked from network); 17 Mar 2019 23:46:36 -0000 X-Authentication-Warning: key0.esi.com.au: damianm owned process doing -bs In-Reply-To: <20190317230729.GQ26605@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:13985 Archived-At: On Mon, 18 Mar 2019, Szabolcs Nagy wrote: > if you improve accuracy without performance loss that sounds useful, but > i cannot comment on it without seeing the patch. The main extra load is rather when computing f = 2 * y + (2 * y * y) / (1 - y) and hfsq = (0.5 * f) * f it is computed using a slightly different formula and then dissected like (f-hfsq) is currently handled in log2.c because of the cancellation error seen around sqrt(2), which in this case is when the absolute value of the argument 'x', i.e. 'y' from MUSL's atanh.c,, has a value of sqrt(2) - 1 ----------- sqrt(2) + 1 I need to work on the code because currently it does not conform to the normal way MUSL is coded. That is somewhat because the C code was ported from a research project which is using the Chapel language and has some design consideration which are irrelevant to MUSL, and others which are are more limiting than what MUSL has. It might take me a few weeks because I have some other work priorities for the next 3 weeks and also need to document the research results for the Chapel project first. Regards - Damian Pacific Engineering Systems International, 277-279 Broadway, 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