This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix for bz#13658 - using fsincos on x86-64
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>,"Carlos O'Donell" <carlos at systemhalted dot org>, jakub at redhat dot com,Andreas Schwab <schwab at redhat dot com>
- Date: Wed, 7 Mar 2012 14:40:43 +0100
- Subject: Re: Fix for bz#13658 - using fsincos on x86-64
- References: <4F343F56.3040402@suse.com> <Pine.LNX.4.64.1202241729460.31204@digraph.polyomino.org.uk> <Pine.LNX.4.64.1203062047350.17270@digraph.polyomino.org.uk>
On Tuesday, March 06, 2012 21:51:53 Joseph S. Myers wrote:
> Any news here? As noted in
> <http://sourceware.org/ml/libc-alpha/2012-02/msg00578.html> I'd like to
> see incremental progress here - some cases fixed, with testcases added,
> even if not all cases are fixed (eventually we should have reasonably
> accurate results for large arguments for all of sin, cos, sincos, tan,
> for all argument types, with associated testcases). That would then
> provide a basis for other people to fix the long double version on top
> of fixes for other types, for example.
>
> Given the use of sincos in other functions, having fixes for sincos is
> important to be able to add tests for large inputs to various other
> functions (in particular, fixing the Bessel function TLOSS issues).
Adding a test for double sincos - after my change for x86-64, gives the following error in the math testsuite:
$ cat math/test-double.out
testing double (without inline functions)
Failure: Test: sincos (1e22, &sin_res, &cos_res) puts -0.8522008497671888017727058937530 in sin_res
Result:
is: 4.62613040764601746169e-01 0x1.d9b73ba325f820000000p-2
should be: -8.52200849767188794992e-01 -0x1.b453ab76bf3970000000p-1
difference: 1.31481389053179054116e+00 0x1.5097a4a4291ac0000000p+0
ulp : 11842790694921048.0000
max.ulp : 0.0000
Failure: Test: sincos (1e22, &sin_res, &cos_res) puts 0.5232147853951389454975944733847 in cos_res
Result:
is: -8.86560305063636922007e-01 -0x1.c5eb3b785c3690000000p-1
should be: 5.23214785395138992641e-01 0x1.0be2cef01c8f40000000p-1
difference: 1.40977509045877580363e+00 0x1.68e705343c62e0000000p+0
ulp : 12698125144132700.0000
max.ulp : 0.0000
Maximal error of `sincos'
is : 12698125144132700 ulp
accepted: 1 ulp
So, the result has nothing to do with the expected result. The test passes on x86-64.
I could add the testcase and the fix for x86-64 and not run it on i386 - or only run it on x86-64. What do you propose?
Right now my testsuite change is:
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 9bdbc4c..1020ceb 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -6426,7 +6426,9 @@ sincos_test (void)
#ifdef TEST_DOUBLE
TEST_extra (sincos, 0.80190127184058835, 0.71867942238767868, 0.69534156199418473);
+ TEST_extra (sincos, 1e22, -0.8522008497671888017727058937530, 0.5232147853951389454975944733847);
#endif
+
END (sincos);
}
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