[PATCHv3] New generic sinf

Joseph Myers joseph@codesourcery.com
Thu Nov 2 17:00:00 GMT 2017


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



More information about the Libc-alpha mailing list