cvs commit: src/lib/msun/src e_coshf.c

Bruce Evans bde at FreeBSD.org
Sun Nov 13 00:08:23 GMT 2005


bde         2005-11-13 00:08:23 UTC

  FreeBSD src repository

  Modified files:
    lib/msun/src         e_coshf.c 
  Log:
  Fixed some magic numbers.
  
  The threshold for not being tiny was confusing and too small.  Use the
  usual 2**-12 threshold and simplify the algorithm slightly so that
  this threshold works (now use the threshold for sinhf() instead of one
  for 1+expm1()).  This is just a small optimization.
  
  The magic number 22 is log(DBL_EPSILON)/2 plus slop.  This is bogus
  for float precision.  Use 9 (~log(FLT_EPSILON)/2 plus less slop than
  for double precision).
  
  The threshold for switching from returning exp(x)/2 to returning
  exp(x/2)^2/2 was a little smaller than necessary.  This was not quite
  harmless since the exp(x/2)^2/2 case is inaccurate.  Fixing it happens
  to avoid accuracy problems for 2*6 of the 2*151 args that were handled
  by the exp(x)/2 case.  This leaves accuracy problems for about 2*19997
  args near the overflow threshold (~89); the maximum error there is
  2.5029 ulps.
  
  There are also accuracy probles for args in +-[0.5*ln2, 9] -- 2*188885
  args with errors of more than 1 ulp, with a maximum error of 1.384 ulps.
  
  Fixed a syntax error and naming errors in pseudo-code in comments.
  
  Revision  Changes    Path
  1.7       +6 -6      src/lib/msun/src/e_coshf.c


More information about the cvs-src mailing list