Date: Sun, 12 Aug 2012 22:37:22 -0000 From: Steve Kargl <sgk@troutmask.apl.washington.edu> To: Stephen Montgomery-Smith <stephen@missouri.edu> Cc: Diane Bruce <db@db.net>, John Baldwin <jhb@freebsd.org>, David Chisnall <theraven@freebsd.org>, Bruce Evans <bde@freebsd.org>, Bruce Evans <brde@optusnet.com.au>, David Schultz <das@freebsd.org>, Peter Jeremy <peter@rulingia.com>, Warner Losh <imp@bsdimp.com> Subject: Re: Use of C99 extra long double math functions after r236148 Message-ID: <20120717040118.GA86840@troutmask.apl.washington.edu> Resent-Message-ID: <20120812223715.GC20453@server.rulingia.com> In-Reply-To: <5004DEA9.1050001@missouri.edu> References: <20120711223247.GA9964@troutmask.apl.washington.edu> <20120713114100.GB83006@server.rulingia.com> <201207130818.38535.jhb@freebsd.org> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 16, 2012 at 10:40:25PM -0500, Stephen Montgomery-Smith wrote: > > I came up with pseudo code that looks a bit like this. > > complex casinh(complex z) { > double x = z.re, y = z.im; > > if (y==0) > return asinh(x); > if (x==0) { > if (fabs(y)<=1) return I*asin(y); > else return signum(y)* ( > log(fabs(y)+sqrt(y*y-1)) > + I*PI/2); Stop. Please see msun/src/math_private.h. You cannot use I in any expression. gcc in base and clang do not do the arithmetic correctly. See msun/src/s_ccosh.c for how one might approach writing these functions. Also, consult n1256.pdf for x,y = +-0, +-inf, nan. There are specific requirements that must be met. -- Steve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120717040118.GA86840>