From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13848 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: x87 asin and acos Date: Sat, 23 Feb 2019 10:08:58 -0500 Message-ID: <20190223150858.GM23599@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="34731"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Shane Seelig To: musl@lists.openwall.com Original-X-From: musl-return-13864-gllmg-musl=m.gmane.org@lists.openwall.com Sat Feb 23 16:09:15 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 1gxYvR-0008ti-89 for gllmg-musl@m.gmane.org; Sat, 23 Feb 2019 16:09:13 +0100 Original-Received: (qmail 24551 invoked by uid 550); 23 Feb 2019 15:09:11 -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 24527 invoked from network); 23 Feb 2019 15:09:10 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13848 Archived-At: On Sat, Feb 23, 2019 at 09:21:08AM -0500, Shane Seelig wrote: > Currently 'asin' uses the algorithm: > arcsin(x) == arctan(x/(sqrt((1-x)(1+x)))) > If the following algorithm were to be used instead, an 'fadd' could be > removed. > arcsin(x) == arctan(x/(sqrt(1-x**2))) They don't seem to be numerically equal. For example, if x is smaller than sqrt(LDBL_EPSILON/2), 1-x**2 is 1, but (1-x)*(1+x) is not. I don't recall the process of writing the function in detail, but I'm pretty sure this matters to the result, especially since sqrt then expands the magnitude of the error. Rich