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: k_sinl bug fix for ldbl-128 and ldbl-128ibm


From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Fri, 16 Mar 2012 00:53:19 +0000 (UTC)

> This *untested* patch fixes the problem I noticed while preparing the
> ldbl-96 sinl/cosl patch.  Some code in __kernel_sinl, which is trying
> to compute the sine of x+y, replaces x by fabsl (x), then changes the
> x+y pair to an h+l pair (where h has a precomputed sine and cosine,
> and |l| <= 1/256.0).  If x was negated, this should be allowed for
> when y is included in the computation of the new low part l - but it
> isn't allowed for, meaning l is off by |2y|.
> 
> This won't make a difference of more than an ulp or two; the evidence
> that it is a useful fix is that the corresponding ldbl-96 fix reduced
> the number of ulps updates needed in that patch on x86 from 30 to 20.
> 
> Comments?  I can do some testing if needed, but some other people may
> be more conveniently set up to test ldbl-128 and ldbl-128ibm than I
> am.  (It is of course possible that in particular cases a more
> accurate internal calculation leads to a less accurate final result
> and so some ulps baseline changes may be needed.)

This gives new ULPs on sparc, this is test-ldouble.out:

testing long double (without inline functions)
Failure: Test: cos_upward (1) == 0.5403023058681397174009366074429766037323
Result:
 is:          5.40302305868139717401e-01   0x1.14a280fb5068b923848dp-1
 should be:   5.40302305868139717401e-01   0x1.14a280fb5068b923848dp-1
 difference:  9.62964972193617926528e-35   0x1.00000000000000000000p-113
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: cos_upward (4) == -0.6536436208636119146391681830977503814241
Result:
 is:         -6.53643620863611914639e-01  -0x1.4eaa606db24c0c466da2p-1
 should be:  -6.53643620863611914639e-01  -0x1.4eaa606db24c0c466da2p-1
 difference:  9.62964972193617926528e-35   0x1.00000000000000000000p-113
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: sin_downward (9) == 0.4121184852417565697562725663524351793439
Result:
 is:          4.12118485241756569756e-01   0x1.a6026360c2f90921c9d3p-2
 should be:   4.12118485241756569756e-01   0x1.a6026360c2f90921c9d3p-2
 difference:  4.81482486096808963264e-35   0x1.00000000000000000000p-114
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: sin_upward (6) == -0.2794154981989258728115554466118947596280
Result:
 is:         -2.79415498198925872812e-01  -0x1.1e1f18ab0a2c03a62441p-2
 should be:  -2.79415498198925872812e-01  -0x1.1e1f18ab0a2c03a62441p-2
 difference:  4.81482486096808963264e-35   0x1.00000000000000000000p-114
 ulp       :  1.0000
 max.ulp   :  0.0000

Test suite completed:
  4803 test cases plus 3969 tests for exception flags executed.
  4 errors occurred.


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