From owner-freebsd-numerics@freebsd.org Wed Feb 8 17:28:59 2017 Return-Path: Delivered-To: freebsd-numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34298CD699D for ; Wed, 8 Feb 2017 17:28:59 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from um-kip8-missouri-out.um.umsystem.edu (um-kip8-missouri-out.um.umsystem.edu [209.106.229.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "um-kip5.um.umsystem.edu", Issuer "InCommon RSA Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAE5F18D0 for ; Wed, 8 Feb 2017 17:28:58 +0000 (UTC) (envelope-from stephen@missouri.edu) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FaBwC7VJtY/yI40cZdFgUBAQEDAQEBC?= =?us-ascii?q?QEBAYQyKl8BBo5MkReXQgEpgkKDNgKDLxQBAgEBAQEBAQEDXyiCWz08AQEBAQE?= =?us-ascii?q?BIwINBlgBBXkQAgEIDgouMiUCBA0BBwEBiXAOsj+IDgEHgz4BAQEHAQEBAQEji?= =?us-ascii?q?FGCaoREEIVlBZtwAYZsjXOON5MTNiJ+UROEfgIdgWF1h3IBgQsBAQE?= X-IPAS-Result: =?us-ascii?q?A2FaBwC7VJtY/yI40cZdFgUBAQEDAQEBCQEBAYQyKl8BBo5?= =?us-ascii?q?MkReXQgEpgkKDNgKDLxQBAgEBAQEBAQEDXyiCWz08AQEBAQEBIwINBlgBBXkQA?= =?us-ascii?q?gEIDgouMiUCBA0BBwEBiXAOsj+IDgEHgz4BAQEHAQEBAQEjiFGCaoREEIVlBZt?= =?us-ascii?q?wAYZsjXOON5MTNiJ+UROEfgIdgWF1h3IBgQsBAQE?= Received: from ex-n22.um.umsystem.edu (HELO EX2-N22.um.umsystem.edu) ([198.209.56.34]) by um-kip8-exch-relay.um.umsystem.edu with ESMTP; 08 Feb 2017 11:27:30 -0600 Received: from EX2-T13.um.umsystem.edu (198.209.56.19) by EX2-N22.um.umsystem.edu (198.209.56.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 8 Feb 2017 11:27:30 -0600 Received: from EX2-T13.um.umsystem.edu ([198.209.56.19]) by EX2-T13.um.umsystem.edu ([198.209.56.19]) with mapi id 15.01.0669.032; Wed, 8 Feb 2017 11:27:30 -0600 From: "Montgomery-Smith, Stephen" To: Bruce Evans CC: "freebsd-numerics@freebsd.org" Subject: Re: C11 conformance of casinl-like functions. Thread-Topic: C11 conformance of casinl-like functions. Thread-Index: AQHSgfsFxO+P4JscBEe/hcN6eq2YKqFfYGeAgAATGoCAAB0GAIAACwiAgAAmToA= Date: Wed, 8 Feb 2017 17:27:30 +0000 Message-ID: <2ecd42a5-7fa3-a06e-a1cf-e82961382b46@missouri.edu> References: <20170208221449.K14261@besplex.bde.org> <0256e890-05ca-6a1b-9635-88034c544724@missouri.edu> <20170209014517.Y17120@besplex.bde.org> In-Reply-To: <20170209014517.Y17120@besplex.bde.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [128.206.49.160] Content-Type: text/plain; charset="Windows-1252" Content-ID: <4E6071F25233484E86D14EEEBAC308F4@missouri.edu> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2017 17:28:59 -0000 On 02/08/17 09:10, Bruce Evans wrote: > On Wed, 8 Feb 2017, Montgomery-Smith, Stephen wrote: > >> On 02/08/17 06:47, mokhi wrote: >>>> I think you mean acosl, asinl, ... >>> yeah :D >>> >>>> These were implemented quite well in 2012-2013, but not quite >>>> finished, >>>> and not committed. Only the float and double version were committed. >>>> The raw versions are still available in >>>> https://people.freebsd.org/~stephen/catrig*.c. These have rotted and >>>> require some editing. Compare with the committed parts to see most >>>> of the necessary editing. >>> Okay, I'll do. >>> Would you like that I add you on Phabricator for reviewing when my >>> editing is done? >>> >>> Thanks and best wishes, Mokhi. >> >> I would love to see these functions implemented. I spent a lot of time >> on them, and they went through a lot of testing to make sure they were >> accurate, even in very extreme edge cases. > > It was you that implemented them :-). Except for many onerous details > like testing on all supported arches and committing them. > >> Here are more details about the implementation. >> >> http://faculty.missouri.edu/~stephen/software/#catrig > > It says that the the results are good to 4 ulps except in float precision= . > I dout that that is correct. Higher precisions are just less likely to > get near the corner cases where the errors are larger. > > Corner cases are probably only near zeros and poles, but I test the > real and imaginary parts separately and this gives a dubious size for > an ulp (for the error relative to each part instead of relative to > the absolute value of the result). This gives 1-dimensional sets of > corner cases. The functions try to get a small error by this measure > and mostly succeed. > > Bruce I did some very extensive testing. In fact, I was able to find an edge=20 case in which the paper by Hull, Fairgrieve and Tang had a mistake if=20 one measured the real and imaginary parts separately for cacos/cacosh.=20 I corrected this in the Boost library:=20 https://svn.boost.org/trac/boost/ticket/7290 The algorithm in the paper by Hull, Fairgrieve and Tang would compute=20 cacos(1.00000002785941 + I*5.72464869028403e-200) as (approximately) 0 - I*0.000236048349018331 whereas it should be (approximately) 2.42520172707401e-196 - I*0.000236048349018331. (This is not only close to a zero of acos, I think it is also the end of=20 a branch point.)=