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 clog, clog10 spurious underflow exceptions (bug 14337)


On Saturday, July 07, 2012 22:26:13 Joseph S. Myers wrote:
> Bug 14337 is spurious underflow exceptions from clog and clog10
> functions when one part of the argument is large and the other part is
> small enough that scaling down by a factor of 2 results in underflow.
> If the large part is the real part, and is positive, then underflow
> is correct (the final imaginary part of the result underflows);
> otherwise it is spurious (the final imaginary part is very close to
> plus or minus pi or pi/2).
> 
> This patch fixes this bug by just using 0.0 instead of a scaled value
> if scaling could underflow.  After this patch, the scaled values or
> 0.0 are only used for hypot, with the original values being passed to
> atan2, so atan2 ensures that underflow exceptions do still occur in
> the case when they are correct (clog argument with small imaginary
> part and large positive real part).
> 
> Tested x86_64 and x86 and ulps updated accordingly.
> 
> 2012-07-07  Joseph Myers  <joseph@codesourcery.com>
> 
> 	[BZ #14337]
> 	* math/s_clog.c (__clog): Avoid scaling a value down where that
> 	could result in underflow.
> 	* math/s_clog10.c (__clog10): Likewise.
> 	* math/s_clog10f.c (__clog10f): Likewise.
> 	* math/s_clog10l.c (__clog10l): Likewise.
> 	* math/s_clogf.c (__clogf): Likewise.
> 	* math/s_clogl.c (__clogl): Likewise.
> 	* math/libm-test.inc (clog_test): Add more tests.
> 	(clog10_test): Likewise.
> 	* sysdeps/i386/fpu/libm-test-ulps: Update.
> 	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

Thanks,  this is fine,

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]