From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10393 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] math: fix 128bit long double inverse trigonometric functions Date: Tue, 23 Aug 2016 21:47:53 +0200 Message-ID: <20160823194752.GH1280@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1471981693 26663 195.159.176.226 (23 Aug 2016 19:48:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2016 19:48:13 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) Cc: Roland McGrath To: musl@lists.openwall.com Original-X-From: musl-return-10406-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 23 21:48:09 2016 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.84_2) (envelope-from ) id 1bcHg8-0006Ul-IH for gllmg-musl@m.gmane.org; Tue, 23 Aug 2016 21:48:08 +0200 Original-Received: (qmail 24079 invoked by uid 550); 23 Aug 2016 19:48:06 -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 24050 invoked from network); 23 Aug 2016 19:48:05 -0000 Mail-Followup-To: musl@lists.openwall.com, Roland McGrath Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:10393 Archived-At: there was a copy paste error that could cause large ulp errors in atan2l, atanl, asinl and acosl on aarch64, mips64 and mipsn32. (the implementation is from freebsd fdlibm, but the tail end of the polynomial was wrong. 128 bit long double functions are not yet tested so this went undetected.) --- this was found by the change https://fuchsia.googlesource.com/magenta/+/5fd5aa1b2e567f6b6633fc84ea84443b496f7eb6%5E%21 i tested manually at a few inputs that the patch is sound, the bug did not cause completely wrong results, the first couple bits were fine since the leading coefficients were correct. src/math/__invtrigl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/__invtrigl.c b/src/math/__invtrigl.c index ef7f4e1..48f83aa 100644 --- a/src/math/__invtrigl.c +++ b/src/math/__invtrigl.c @@ -57,7 +57,7 @@ long double __invtrigl_R(long double z) { long double p, q; p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*(pS5+z*(pS6+z*(pS7+z*(pS8+z*pS9))))))))); - q = 1.0+z*(qS1+z*(qS2+z*(qS3+z*(qS4+z*(qS5+z*(pS6+z*(pS7+z*(pS8+z*pS9)))))))); + q = 1.0+z*(qS1+z*(qS2+z*(qS3+z*(qS4+z*(qS5+z*(qS6+z*(qS7+z*(qS8+z*qS9)))))))); return p/q; } #endif -- 2.8.1