Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Nov 2005 00:08:23 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/lib/msun/src e_coshf.c
Message-ID:  <200511130008.jAD08NTn059874@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511130008.jAD08NTn059874>