roff source from the Linux documentation project.
Modifications before import:
-added NetBSD RCS ID
-removed Linux PROLOG and declarations with "long double"
-ran the "deshallify" script as required by The Open Group
Split out complex related things into an own Makefile fragment.
Thanks to hubertf for directions.
leads to loss of precision, leading to rounding into the wrong direction
for the case 0.5-epsilon. use floor() instead.
This also fixes a wrong sign of zero returned with non-default rounding
directions.
Most complex function implementations are from the "c9x-complex" library,
originating from the "cephes" math library, see
http://www.netlib.org/cephes/, from Stephen L. Moshier, incorporated and
redistributed with the NetBSD license by permission of the author.
Error behaviour and other boundary conditions (branch cuts)
need to be looked at.
For namespace sanity, I've done the rename/weak alias procedure to
most of the exported functions which are also used internally.
Didn't do so for sin/cos(f) yet because assembler implementations use
them directly, and renaming functions shared between the main libm
and the machine specific "overlay" might raise binary compatibility
issues.
conflict with C99 functions which are builtins in newer gcc
(actually, the old cabs() is ABI compatible with the new _complex one
on i386, but this is purely accidental)
remove public prototypes and manpages, move the code into a compat
subdirectory as libc does so that binary compatibility is kept
-add a manpage for the isgreater() etc macros, borrowed from FreeBSD
(not quite a merge actually, just an #ifdef for now)
and build it in the i386 case (amd64 should work, just needs to be tested)
That way, a program linking against libm should get the optimized
version as expected.
While the versions in libc/gen are prettier to look at, having single
precision versions in libm and double precision versions in libc causes
a lot of confusion, and to favor libm gets us coprocessor support.