This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356)

On 12/20/2013 11:08 PM, Joseph S. Myers wrote:
> This patch fixes bug 16356, bad results from x86 / x86_64 expl /
> exp10l in directed rounding modes, the most serious of the bugs shown
> up by my patch expanding libm test coverage.  When I fixed bug 16293,
> I thought it was only necessary to set round-to-nearest when using
> frndint in expm1 functions, because in other cases the cancellation
> error from having the resulting fractional part close to 1 or -1 would
> not be significant.  However, in expl and exp10l, the way the final
> fractional part gets computed (something more complicated than a
> simple subtraction, because more precision is needed than you'd get
> that way) can result in a value outside the range [-1, 1] when the
> argument to frndint was very close to an integer and was rounded the
> "wrong" way because of the rounding mode - and the f2xm1 instruction
> has undefined results if its argument is outside [-1, 1], so resulting
> in the large errors seen.  So this patch removes the USE_AS_EXPM1L
> conditionals on the round-to-nearest settings, so all of expl, expm1l
> and exp10l now get round-to-nearest used for frndint (meaning the
> final fractional part can at most be slightly above 0.5 in
> magnitude).  Associated tests of exp and exp10 are added and testing
> of exp10 in directed rounding modes enabled.

 Andreas Jaeger aj@{,} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]