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

Bruce Evans bde at FreeBSD.org
Sat Feb 9 04:53:16 PST 2008


bde         2008-02-09 12:53:15 UTC

  FreeBSD src repository

  Modified files:
    lib/msun/src         s_expm1f.c 
  Log:
  As usual, use a minimax polynomial that is specialized for float
  precision.  The new polynomial has degree 4 instead of 10, and a maximum
  error of 2**-30.04 ulps instead of 2**-33.15.  This doesn't affect the
  final error significantly; the maximum error was and is about 0.5015
  ulps on i386 -O1, and the number of cases with an error of > 0.5 ulps
  is increased from 13851 to 14407.
  
  Note that the error is only this close to 0.5 ulps due to excessive
  extra precision caused by compiler bugs on i386.  The extra precision
  could be obtained intentionally, and is useful for keeping the error
  of the hyperbolic float functions below 1 ulp, since these functions
  are implemented using expm1f.  My recent change for scaling by 2**k
  had the unintentional side effect of retaining extra precision for
  longer, so callers of expm1f see errors of more like 0.0015 ulps than
  0.5015 ulps, and for the hyperbolic functions this reduces the maximum
  error from nearly about 2 ulps to about 0.75 ulps.
  
  This is about 10% faster on i386 (A64).  expm1* is still very slow,
  but now the float version is actually significantly faster.  The
  algorithm is very sophisticated but not very good except on machines
  with fast division.
  
  Revision  Changes    Path
  1.9       +8 -7      src/lib/msun/src/s_expm1f.c


More information about the cvs-all mailing list