freebsd-dev/lib
Bruce Evans ce804bff58 Fixed code to match comments and the algorithm:
- in preparing for the third approximation, actually make t larger in
  magnitude than cbrt(x).  After chopping, t must be incremented by 2
  ulps to make it larger, not 1 ulp since chopping can reduce it by
  almost 1 ulp and it might already be up to half a different-sized-ulp
  smaller than cbrt(x).  I have not found any cases where this is
  essential, but the think-time error bound depends on it.  The relative
  smallness of the different-sized-ulp limited the bug.  If there are
  cases where this is essential, then the final error bound would be
  5/6+epsilon instead of of 4/6+epsilon ulps (still < 1).
- in preparing for the third approximation, round more carefully (but
  still sloppily to avoid branches) so that the claimed error bound of
  0.667 ulps is satisfied in all cases tested for cbrt() and remains
  satisfied in all cases for cbrtf().  There isn't enough spare precision
  for very sloppy rounding to work:
  - in cbrt(), even with the inadequate increment, the actual error was
    0.6685 in some cases, and correcting the increment increased this
    a little.  The fix uses sloppy rounding to 25 bits instead of very
    sloppy rounding to 21 bits, and starts using uint64_t instead of 2
    words for bit manipulation so that rounding more bits is not much
    costly.
  - in cbrtf(), the 0.667 bound was already satisfied even with the
    inadequate increment, but change the code to almost match cbrt()
    anyway.  There is not enough spare precision in the Newton
    approximation to double the inadequate increment without exceeding
    the 0.667 bound, and no spare precision to avoid this problem as
    in cbrt().  The fix is to round using an increment of 2 smaller-ulps
    before chopping so that an increment of 1 ulp is enough.  In cbrt(),
    we essentially do the same, but move the chop point so that the
    increment of 1 is not needed.

Fixed comments to match code:
- in cbrt(), the second approximation is good to 25 bits, not quite 26 bits.
- in cbrt(), don't claim that the second approximation may be implemented
  in single precision.  Single precision cannot handle the full exponent
  range without minor but pessimal changes to renormalize, and although
  single precision is enough, 25 bit precision is now claimed and used.

Added comments about some of the magic for the error bound 4/6+epsilon.
I still don't understand why it is 4/6+ and not 6/6+ ulps.

Indent comments at the right of code more consistently.
2005-12-18 21:46:47 +00:00
..
bind Finish the removal of threads support in ../config.mk,v 1.15. 2005-11-07 15:22:35 +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 [mdoc] add missing space before a punctuation type argument. 2005-12-13 17:07:52 +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 Implement ELF symbol versioning using GNU semantics. This code aims 2005-12-18 19:43:33 +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 Fix prototypes. 2005-11-24 10:30:44 +00:00
libedit Merge NetBSD's revision 1.27. This bug can be observed eg. when browsing 2005-12-04 09:34:56 +00:00
libexpat Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libfetch Fix misspelling in Poul-Henning Kamp's email address under AUTHORS, from 2005-11-30 04:08:45 +00:00
libform Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libftpio Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libgeom Fix prototype. 2005-11-24 10:43:35 +00:00
libgpib Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libio
libipsec Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libipx
libkiconv - Fix checking range of strings of struct iconv_add_in in libsmb and libkiconv, 2005-08-24 12:38:26 +00:00
libkse o Include <sys/time.h> 2005-11-19 04:47:06 +00:00
libkvm Fix a well duplicated fencepost error that stopped crashdumps being 2005-10-20 05:41:38 +00:00
libmagic Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libmd -mdoc sweep. 2005-11-17 13:00:00 +00:00
libmemstat Tidy up markup and fix two bugs. 2005-11-21 17:18:34 +00:00
libmenu Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libmilter
libmp Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libncp Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libncurses Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libnetgraph Recognize all current standard node types. 2005-10-25 20:58:30 +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 Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libpcap bump SHLIB_MAJOR as libpcap refers getnetbyname(3). 2005-06-03 09:41:26 +00:00
libpmc Fix prototypes. 2005-11-24 10:54:47 +00:00
libpthread o Include <sys/time.h> 2005-11-19 04:47:06 +00:00
libradius Add missing shared library interdependencies. 2005-11-10 18:07:07 +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 Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libsmdb
libsmutil
libstand Fix prototypes. 2005-11-24 11:14:06 +00:00
libtacplus Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libtelnet
libthr Update copyright. 2005-12-17 09:42:45 +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 Fix prototypes. 2005-11-24 11:26:36 +00:00
libutil Restore the previous state after a FILL operation in properties_read() 2005-11-28 16:30:16 +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 code to match comments and the algorithm: 2005-12-18 21:46:47 +00:00
ncurses Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
Makefile Disconnect libc_r from buildworld, it is still kept in the tree to 2005-10-27 03:09:20 +00:00
Makefile.inc Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00