From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3312 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Using float_t and double_t in math functions Date: Thu, 9 May 2013 21:14:25 +0200 Message-ID: <20130509191425.GH12689@port70.net> References: <20130509014327.GA6338@brightrain.aerifal.cx> <20130509132157.GF12689@port70.net> <20130509145714.GL20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1368126882 8368 80.91.229.3 (9 May 2013 19:14:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 May 2013 19:14:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3316-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 09 21:14:40 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UaWIY-00081X-H6 for gllmg-musl@plane.gmane.org; Thu, 09 May 2013 21:14:38 +0200 Original-Received: (qmail 13795 invoked by uid 550); 9 May 2013 19:14:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 13785 invoked from network); 9 May 2013 19:14:37 -0000 Content-Disposition: inline In-Reply-To: <20130509145714.GL20323@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3312 Archived-At: * Rich Felker [2013-05-09 10:57:14 -0400]: > > Do you want to do it, or do you want me to? I don't mind but you're > more familiar with the code and probably better aware of where it's > okay to change. (BTW, it's probably not safe to change arg-reduction > code, right?) > i will do it, but it will take some time there are some simple cases like sinf where it should clearly work (polynomial evals, most temporaries) but in other cases the excess precision can actually hurt (correctly rounded operations, double-double representation, over/underflow flags should be raised,..) and there are some non-trivial cases eg. acosh(x) for large x is ln(2*x), or to avoid overflow: log(x) + 0.693147180559945309417232121458176568; which could be rewritten as log(x) + (double_t)0.693147180559945309417232121458176568L; so gcc recognizes the const and uses fldln2 on i386 (which probably saves 1-2 bytes) (the double rounding is not an issue for special consts) so i think this will need to be done with extensive testing and inspection of the generated code