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: correct rounding or not?


On 29/01/2020 16:36, paul zimmermann wrote:
>        Hi,
> 
> in sysdeps/ieee754/dbl-64 one can find code coming from IBM's
> Accurate Mathematical Library (libultim), with comments claiming
> for correct rounding, for example in s_sin.c one can read around
> lines 194-197:
> 
> /*******************************************************************/
> /* An ultimate sin routine. Given an IEEE double machine number x   */
> /* it computes the correctly rounded (to nearest) value of sin(x)  */
> /*******************************************************************/
> ...
> __sin (double x)
> 
> However, it appears that the __sin function is not correctly rounded,
> for example for x=8.5546900000006210e-01 it gives 7.5487859961632653e-01
> whereas the correct rounding is 7.5487859961632664e-01 (according to mpfr).
> 
> Maybe the original code from libultim was modified, in particular the
> code that guarantees correct rounding (rounding test + slow path) was
> removed?
> 
> Anyway, I believe the comments should be modified to accurately
> describe what the current code does.

yes the comments were likely left untouched
when the slow paths were removed, i agree
that this should be fixed.

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