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]

Results of cos(pi/2) tests are dependent on error rounding pi/2 to a type.


Community,

I've recently fixed the cos(pi/2) tests to expect the correct
result from the rounding of pi/2. The tests previously expected
cos(M_PI_2l) to return 0.0, but this is naive. The actual answer
is a non-zero value almost equal to the error in rounding pi/2
to the floating point representation.

The first derivitive of cos(pi/2) is ~1, therefore any error
in pi/2 has a direct and linear effect on the result of the answer
either causing it to be slightly more than 0 or slightly less than
zero. The exact answer to cos(pi/2) is highly dependent on the type
used.

I've tried to take into account all of the types, but in the event
that I've made a mistake please come to me and I'll help fix it.

Cheers,
Carlos.


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