Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2012 22:57:40 -0000
From:      Peter Jeremy <peter@rulingia.com>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        Diane Bruce <db@db.net>, John Baldwin <jhb@freebsd.org>, David Chisnall <theraven@freebsd.org>, Stephen Montgomery-Smith <stephen@missouri.edu>, Bruce Evans <bde@freebsd.org>, Bruce Evans <brde@optusnet.com.au>, David Schultz <das@freebsd.org>, Warner Losh <imp@bsdimp.com>
Subject:   Re: Use of C99 extra long double math functions after r236148
Message-ID:  <20120717225328.GA86902@server.rulingia.com>
Resent-Message-ID: <20120812225732.GG20453@server.rulingia.com>
In-Reply-To: <20120717043848.GB87001@troutmask.apl.washington.edu>
References:  <9EB2DA4F-19D7-4BA5-8811-D9451CB1D907@theravensnest.org> <C527B388-3537-406F-BA6D-2FA45B9EAA3B@FreeBSD.org> <20120713155805.GC81965@zim.MIT.EDU> <20120714120432.GA70706@server.rulingia.com> <20120717084457.U3890@besplex.bde.org> <5004A5C7.1040405@missouri.edu> <5004DEA9.1050001@missouri.edu> <20120717040118.GA86840@troutmask.apl.washington.edu> <20120717042125.GF66913@server.rulingia.com> <20120717043848.GB87001@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--JP+T4n/bALQSJXh8
Content-Type: multipart/mixed; boundary="0OAP2g/MAC+5xKAE"
Content-Disposition: inline


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2012-Jul-16 21:38:48 -0700, Steve Kargl <sgk@troutmask.apl.washington.ed=
u> wrote:
>On Tue, Jul 17, 2012 at 02:21:25PM +1000, Peter Jeremy wrote:
>> Again, handling the special cases listed in G.6 is all just
>> boilerplate code that we can take as assumed for pseudocode.  IMO, it
>
>As someone who spent 10+ years getting sqrtl(), cbrtl(), ccosh(), sinl(),
>cosl(), tanl(), etc into FreeBSD, I respectfully disagree with your
>take that it is just boilerplate.  Getting this stuff right is much harder
>than I think some people understand.  Oh well, I'll back to lurking and
>working on things I need.

OK.  I'll admit that I haven't tried this before but attached is my
first try at catan[h]().  It should cover all the special casing
according to WG14/N1256 and compiles if you add the relevant
declarations to complex.h.  I'd appreciate feedback.

Notes on it:
- The actual code at the end of catanh() is just one possible
  algorithm.  It's not intended as final code and the final code is
  likely to need additional special case handling to minimise
  precision loss and prevent unwanted exceptions.
- cpack(-cimag(r), -creal(r)) gives better code than
  -cpack(cimag(r), creal(r)) on i386 and identical code on amd64.
- The fpclassify() macros are bitmasks on FreeBSD.  Assuming this
  would allow (ci =3D=3D FP_ZERO || ci =3D=3D FP_NAN) to be simplified but =
the
  standard only requires that they have distinct values and (eg)
  Solaris implements them as a series so the current code is more
  portable.

--=20
Peter Jeremy

--0OAP2g/MAC+5xKAE--

--JP+T4n/bALQSJXh8
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlAF7OgACgkQ/opHv/APuIfXQACgiDp/QmvWDA0PLVQTSKJ2EwO+
XE0An1fLjJbEROoRhdKA94UapHEg4rn6
=L/Yi
-----END PGP SIGNATURE-----

--JP+T4n/bALQSJXh8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120717225328.GA86902>