This is the mail archive of the libc-alpha@sourceware.org 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 ldbl-128 lgammal for small negative arguments (bug 16337)


On 12/22/2013 03:20 AM, Joseph S. Myers wrote:
> This patch fixes bug 16337, ldbl-128 lgammal spurious overflows for
> small negative arguments (the arguments in question are already in the
> testsuite).  The implementation uses the reflection formula to compute
> lgamma of negative x from lgamma of -x, effectively resulting in a
> calculation -log(x^2) + log(-x); cancellation isn't problematic in
> this case (bugs for problematic cancellation in lgamma are 2542, 2543,
> 2558), but the x^2 calculation can underflow (in which case there is
> spurious logic to return an overflowing value - lgamma can only ever
> correctly overflow for large positive arguments, though tgamma can
> overflow for small arguments of either sign as well as large positive
> arguments).  The fix is simply to calculate the result directly with
> logl when the argument is a small enough negative number.

ok, thanks,

Andreas
-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} 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]