This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv3] New generic sinf
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 2 Nov 2017 17:00:11 +0000
- Subject: Re: [PATCHv3] New generic sinf
- Authentication-results: sourceware.org; auth=none
- References: <1509637838-21839-1-git-send-email-raji@linux.vnet.ibm.com>
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