freebsd-dev/lib
Bruce Evans 74bbe8ed42 Fixed range reduction for large multiples of pi/2 on systems with
broken assignment to floats (e.g., i386 with gcc -O, but not amd64 or
ia64; i386 with gcc -O0 worked accidentally).

Use an unnamed volatile temporary variable to trick gcc -O into clipping
extra precision on assignment.  It's surprising that only 1 place needed
to be changed.

For tanf() on i386 with gcc -O, the bug caused errors > 1 ulp with a
density of 2.3% for args larger in magnitude than 128*pi/2, with a
maximum error of 1.624 ulps.

After this fix, exhaustive testing shows that range reduction for
floats works as intended assuming that it is in within a factor of
about 2^16 of working as intended for doubles.  It provides >= 8
extra bits of precision for all ranges.  On i386:

range                       max error in double/single ulps    extra precision
-----                       -------------------------------    ---------------
0 to 3*pi/4                 0x000d3132  /  0.0016              9+ bits
3*pi/4 to 128*pi/2          0x00160445  /  0.0027              8+
128*pi/2 to +Inf            0x00000030  /  0.00000009          23+
128*pi/2 up, -O0 before fix 0x00000030  /  0.00000009          23+
128*pi/2 up, -O1 before fix 0x10000000  /  0.5                 1

The 23+ bits of extra precision for large multiples corresponds to almost
perfect reduction to a pair of floats (24 extra would be perfect).

After this fix, the maximum relative error (relative to the corresponding
fdlibm double precision function) is < 1 ulp for all basic trig functions
on all 2^32 float args on all machines tested:

          amd64     ia64      i386-O0   i386-O1
	  ------    ------    ------    ------
cosf:     0.8681    0.8681    0.7927    0.5650
sinf:     0.8733    0.8610    0.7849    0.5651
tanf:     0.9708    0.9329    0.9329    0.7035
2005-10-11 07:56:05 +00:00
..
bind Disable thread support in BIND. It appears to reduce performance rather 2005-07-25 14:44:11 +00:00
csu Fixed profiling of main() for amd64 and i386. This started rotting 2005-10-07 22:13:17 +00:00
libalias Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libarchive signed/unsigned fixes (thanks to GCC4) and a few related minor style corrections. 2005-09-24 21:15:00 +00:00
libatm Enforce style.Makefile(5). 2005-04-22 18:57:32 +00:00
libautofs Fix all the spelling mistakes I could find in the man pages for words 2005-07-31 03:30:48 +00:00
libbegemot Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libbluetooth Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libbsnmp Catch up with the import of bsnmp-1.11. Add a couple of new 2005-10-04 15:02:07 +00:00
libbz2 Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libc Fix a long line in copyright notice. 2005-10-03 14:43:27 +00:00
libc_r - Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution. 2005-08-19 21:31:42 +00:00
libcalendar
libcam Better memory handling: 2005-07-13 10:40:07 +00:00
libcom_err
libcompat Expand contractions. 2005-02-13 23:45:54 +00:00
libcrypt Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libdevinfo Add __BEGIN_DECLS/__END_DECLS so that this header can be included in C++ 2005-08-31 14:57:39 +00:00
libdevstat Remove an unused variable. 2005-10-04 22:00:35 +00:00
libdisk Merge two slice_type_name() functions. 2005-04-13 13:42:38 +00:00
libedit Merge makelist rev 1.10 and map.c rev 1.22 from NetBSD. They just patch the 2005-10-04 21:59:29 +00:00
libexpat Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libfetch Ignore HTTP_PROXY if it is defined but empty. This was already handled 2005-08-24 12:28:05 +00:00
libform
libftpio Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libgeom Check for NULL pointer return. 2005-05-24 10:10:38 +00:00
libgpib Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libio Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
libipsec Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libipx Various markup and spelling fixes. 2004-12-29 02:18:24 +00:00
libkiconv - Fix checking range of strings of struct iconv_add_in in libsmb and libkiconv, 2005-08-24 12:38:26 +00:00
libkse Modify the code path of the ifdef NOTYET part of _kse_single_thread(): 2005-09-24 01:19:53 +00:00
libkvm libkvm bits for arm. 2005-10-03 14:21:14 +00:00
libmagic Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libmd Correct type. 2005-09-14 10:42:51 +00:00
libmemstat The "Mbuf" zone was renamed "mbuf" to improve consistency, but the code 2005-08-15 10:24:20 +00:00
libmenu
libmilter NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
libmp Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libncp Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libncurses Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libnetgraph Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libngatm Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libopie Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libpam Commenting out WARNS actually brought it up to 4. 2005-09-28 14:36:16 +00:00
libpanel
libpcap bump SHLIB_MAJOR as libpcap refers getnetbyname(3). 2005-06-03 09:41:26 +00:00
libpmc Add COMPATIBILITY and HISTORY sections. 2005-07-21 06:44:54 +00:00
libpthread Modify the code path of the ifdef NOTYET part of _kse_single_thread(): 2005-09-24 01:19:53 +00:00
libradius Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
librpcsvc Fix the source path. 2005-06-04 10:48:21 +00:00
libsbuf
libsdp Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libsm Add a new source file in sendmail 8.13.4 2005-06-07 04:18:25 +00:00
libsmb Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libsmdb For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
libsmutil For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
libstand Add -mno-sse3 for prescott/nocona 2005-07-15 12:29:31 +00:00
libtacplus Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libtelnet NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
libthr The pthread_attr_set_createsuspend_np was broken, fix it by 2005-10-10 12:15:07 +00:00
libthread_db Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libufs minor style.Makefile(5) fixes: 2005-09-26 06:23:43 +00:00
libugidfw Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libusbhid Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libutil When removing the local domain, only do so when the result will be a 2005-10-05 04:42:20 +00:00
libvgl Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libwrap Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
liby Drop useless with NO_PIC SHLIB_MAJOR. 2005-07-20 14:35:26 +00:00
libypclnt Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libz Correct a buffer overflow which can occur when decompressing a 2005-07-27 08:41:17 +00:00
msun Fixed range reduction for large multiples of pi/2 on systems with 2005-10-11 07:56:05 +00:00
ncurses Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
Makefile Connect smbfs build on powerpc. 2005-09-19 08:13:43 +00:00
Makefile.inc Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00