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: [COMMITTED] math: Use accurate answers for cos and sincos.


On 04/24/2013 04:48 PM, Joseph S. Myers wrote:
> On Wed, 24 Apr 2013, Carlos O'Donell wrote:
> 
>> math: Use accurate answers for cos and sincos.
>>     
>> Use the most accurate hex literals possible for the answers to the
>> cos and sincos tests that vary according to the error in the rounding
>> of PI/2.
> 
> As I noted in <http://sourceware.org/ml/libc-alpha/2013-04/msg00546.html>, 
> really the *inputs* to these tests should be hex floats, the tests 
> themselves should then not be conditional on e.g. "float" (only on having 
> at least the required precision) and the expected *outputs* should be 
> given in precision above that needed for any supported type (whether in 
> hex or decimal doesn't really matter, though decimal is usual for this in 
> libm-test.inc).
> 

Thanks, I see your point about this now. I will get back to this once
I finish:
~~~
 * When {{{libm-test.inc}}} computes ulps for a case where the expected result was 0, it computes them as if the expected result was 1, but should compute them more strictly, as if the expected result was subnormal.
~~~
Which is actually what I'm working on.

I think that this entry in the todo list:
~~~
 * For most cases where {{{libm-test.inc}}} tests specific finite inputs to functions, and associated results, it would make sense for those tests to be generated automatically with MPFR and MPC, with a source file just specifying the inputs, and a program using MPFR and MPC automatically determining the expected results, exceptions and {{{errno}}} values for each of the five supported floating-point formats. This could also be done for all rounding modes automatically, facilitating running all tests in all rounding modes; where inputs are not exactly representable for all floating-point formats, tests could be generated using all the rounded versions of those inputs. (The output generated using MPFR and MPC would probably still be checked in, so that sufficiently recent versions of those libraries are only needed for modifying the tests, not just for testing glibc.) Until {{{errno}}} setting is more reliable, the test source might need to contain indications of which functi!
 ons should
 be expected to set errno in which cases.
~~~
Covers fixing the changes I made to fix cos and sincos.

Cheers,
Carlos.


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