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 float range reduction problems (bug 14283)


On 06/22/2012 10:53 PM, Joseph S. Myers wrote:
This patch (for 2.17) fixes bug 14283 (inaccurate range reduction for
sinf and cosf).  There were two problems I found from the sample tests
I extracted from the provided log: a mistake in adapting the range
reduction code from double to float meant a shift was off-by-one, so
causing loss of precision for values close to a multiple of pi/2, and
the logic producing the final array of float failed to allow for
FLT_EVAL_METHOD the way the double implementation of range reduction
does, causing bad results for 32-bit x86 only.

Tested x86_64 and x86; ulps updates were only needed for x86 in that
testing (the more accurate range reduction ends up adding 1ulp to the
errors for some j1 and y0 tests with large inputs).

2012-06-22 Joseph Myers<joseph@codesourcery.com>

	[BZ #14283]
	* sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Shift
	by 7 not 8 to examine high bit of fractional part.  Use volatile
	variables when splitting into final array of floats if
	__FLT_EVAL_METHOD__ != 0.
	* math/libm-test.inc (cos_test): Add another test.
	(sin_test): Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Update.

Thanks, this is ok,


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]