kern/147599: [libm] [patch] Import netbsd complex functions into our libm

Bruce Evans brde at optusnet.com.au
Tue Sep 28 23:59:58 UTC 2010


On Tue, 28 Sep 2010, Mark Blackman wrote:

> The following reply was made to PR kern/147599; it has been noted by GNATS.
>
> From: Mark Blackman <mark at exonetric.com>
> To: bug-followup at FreeBSD.org,
> db at db.net
> Cc:
> Subject: Re: kern/147599: [libm] [patch] Import netbsd complex functions into our libm
> Date: Tue, 28 Sep 2010 21:44:11 +0100
>
> I'm guessing that gcc has moved on from the issues in 2005? and wouldn't =
> NetBSD have these same
> issues?

Maybe, but FreeBSD still use an old gcc (from 2007?), and now FreeBSD has
clang which seems to be even further from supporting fenv (it does invalid
optimizations in nonstandard rounding modes, and seems to have the same
amount of fenv pragmas as gcc, that is, none, for turning this off).

> In any case, perhaps the apple version is more likely to be suitable?
>
> =
> http://www.opensource.apple.com/source/Libm/Libm-315/Source/Intel/complex.=
> c

This is much better.  Its ccosh() has many similarities to the one that
Steve and I wrote many years ago, but is more sophisticated.  We only
handled special values (Infs, NaNs and +-0) specially.  The apple version
also avoid overflow and loss of precision by using things like expm1().
The NetBSD version just evaluates the infinite-precision formula.

Bruce


More information about the freebsd-bugs mailing list