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: [PATCHv3] New generic sinf


On Thu, 2 Nov 2017, Rajalakshmi Srinivasaraghavan wrote:

> +/* reduced (theta, n, signbit):
> + * Compute sine (n * theta) using Chebyshev polynomials, where
> + * - -Pi/4 <= theta < Pi/4
> + * - n thus indicates the actual quadrant in which n*theta resides.
> + * n is used to decide whether a sine or cosine approximation is
> + * more accurate and the sign of the result.  */

GNU standard does not have the leading '*' on each line of the comment, 
and does not repeat the function name / prototype in the comment; the 
values of arguments should be referred to in uppercase in the comment.

And this function certainly isn't computing sin (n * theta), there's no 
multiplication by n involved.  I think it might actually be something like 
sin (((-1)**SIGNBIT) * (THETA + (N >> 1)*PI/2)), but the comment needs to 
state this, or whatever the actual function calculated is, explicitly 
(along with the constraint on the range for THETA).

-- 
Joseph S. Myers
joseph@codesourcery.com


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