From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:04:31 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7369E106564A for ; Sun, 12 Aug 2012 23:04:31 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id D47EA8FC16 for ; Sun, 12 Aug 2012 23:04:30 +0000 (UTC) Received: from server.rulingia.com (c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CN4Uk9075666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:04:30 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CN4NpN021249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:04:24 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CN4N0D021248 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:04:23 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:04:23 +1000 Resent-Message-ID: <20120812230423.GO20453@server.rulingia.com> Resent-To: freebsd-numerics@freebsd.org From: Peter Jeremy Mail-Followup-To: freebsd-numerics@freebsd.org To: Stephen Montgomery-Smith Message-ID: <20120728125824.GA26553@server.rulingia.com> References: <20120717043848.GB87001@troutmask.apl.washington.edu> <20120717225328.GA86902@server.rulingia.com> <20120717232740.GA95026@troutmask.apl.washington.edu> <20120718001337.GA87817@server.rulingia.com> <20120718123627.D1575@besplex.bde.org> <20120722121219.GC73662@server.rulingia.com> <500DAD41.5030104@missouri.edu> <20120724113214.G934@besplex.bde.org> <501204AD.30605@missouri.edu> <20120727032611.GB25690@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: <20120727032611.GB25690@server.rulingia.com> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Diane Bruce , Bruce Evans , John Baldwin , David Chisnall , Bruce Evans , Steve Kargl , David Schultz , Warner Losh Subject: Re: Use of C99 extra long double math functions after r236148 X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 12 Aug 2012 23:04:31 -0000 X-Original-Date: Sat, 28 Jul 2012 22:58:24 +1000 X-List-Received-Date: Sun, 12 Aug 2012 23:04:31 -0000 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-Jul-27 13:26:11 +1000, Peter Jeremy wro= te: >I've been writing a test harness to vet the special case handling of >all the complex functions (excluding cpow so far). Basically, it's >just Appendix G.6 of WG14/N1256 turned into a C array, plus code to >actually run the tests & interpret the results. So far, it's about >1100 lines of which about 1/3 is the test cases and is intended to run >on x86/armle/sparc and FreeBSD/Linux/Solaris (I'm using Solaris and, >to a lesser extent, Linux as a cross-check on my interpretation of the >text). Once I'm happy with it, I'll circulate it. I was initially >hoping to make it commitable but 8-char tabs and 80-char lines would >require lots of line wrapping that would make it harder for me to >follow. My test harness can be found at http://www.rulingia.com/~peter/ctest.c There are no special compilation options, it just needs to be linked with '-lm' (and '-ldl' on Linux). For normal use, just run the executable - it will report any failures. For "finite" arguments, it currently uses 3=CF=80/4 and 32769 other random numbers (the latter is S_COUNT+1). It has two test modes for internal testing and debugging: '-v' verifies that all the argument & result strings are valid and that there's no duplication of argument vectors (for this purpose, it doesn't consider '0' as finite and will incorrectly report '1' as an invalid argument). '-r' prints all the double-precision test vectors used. This should generate 3604951 lines of output. The output should be reasonably self-explanatory except: - double-precision function names are printed with a trailing 'd' - an expected sign of '?' means "don't care". It reports no errors on OpenSolaris but does report a number of what appear to be valid errors on Linux. Whilst I was debugging the code, I found the following elisp useful for post-processing the output: (progn (downcase-region (point-min) (point-max)) (repl-regexp "^ [ ]c" "..c") (repl-regexp "^ c" ".c") (repl-regexp " *0x[0-9a-f]+ *" " ") (repl-regexp " *0x[0-9a-f]+$" "") (repl-regexp "infinit[y]" "inf") (repl-regexp "0\\.0+e\\+0+\\>" "zer") (repl-regexp "1\\.0+e\\+0+\\>" "one") (repl-regexp "3\\.14159[0-9]+e\\+00" "pi.") (repl-regexp "1\\.57079[0-9]+e\\+00" "p_2") (repl-regexp "7\\.85398[0-9]+e\\-01" "p_4") (repl-regexp "2\\.35619[0-9]+e\\+00" "3p4") (repl-regexp "[0-9]\\.[0-9]+e[-\\+][0-9]+" "fin") (repl-regexp "^ *\012" "") (repl-regexp "\012 *=3D" " =3D") (repl-regexp "\012 *expected: *" " # ") (repl-regexp "\012 *want *" " # ") (repl-regexp " +" " ") (repl-regexp "-\\+" " ") (repl-regexp " +$" "") (repl-regexp "\\([^)]\\)$" "\\1 %%") (repl-regexp "^\\(.*=3D \\)\\(.\\)\\(...\\)\\( .*# \\)\\(.\\)\\3\\(.*\\) %= %" "\\1\\2\\3\\4\\5\\3\\6 \\2\\5") (repl-regexp "\\([^)]\\)$" "\\1 %%") (repl-regexp "^\\(.*=3D .... \\)\\(.\\)\\(...\\)\\( # .... \\)\\(.\\)\\3\\= (.*\\) .." "\\1\\2\\3\\4\\5\\3\\6 \\2\\5") (repl-regexp "^\\(......\\)f\\(:.*\012\\)\\1d\\2\\1l\\2" "\\1x\\2") (repl-regexp "^\\(......\\)d\\(:.*\012\\)\\1f\\2\\1l\\2" "\\1x\\2") ) This turns the output into a series of lines like: =2E.ctanx: +3p4 +inf =3D +zer +one # -zer +one +- ++ fn ^ Argument Result Expected XX YY +- precision (f/d/l) or 'x' if all 3 affected XX and YY are the real and imaginary actual and expected result signs or '%' if the category differs between expected and actual. The above line (from the Linux output) means that ctan(3=CF=80/4 + I*Inf) returns (+0 + I*1) instead of (-0 + I*1) '+-' means that the signs of the real parts differ '++' means that the signs of the imaginary parts are both '+' Please let me know if you find any errors or have any comments. --=20 Peter Jeremy --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlAT4fAACgkQ/opHv/APuIcf6gCfXRQ/V/lSc0x8rk0tjV07WW4y jT8AmgPM2+kWjiJXJM2o9IcptPaW4puI =y2fL -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM--