This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PPC64 libmvec sin, cos, sincos
- From: GT <tnggil at protonmail dot com>
- To: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Sun, 03 Mar 2019 17:21:16 +0000
- Subject: PPC64 libmvec sin, cos, sincos
- Reply-to: GT <tnggil at protonmail dot com>
Here is a suggestion to organize the implementation of the three functions
a little differently than was done for x86_64.
Because of the trigonometric identity cos (x) = sin( x + PI/2), selecting
either the sine or cosine polynomial series approximation should suffice to
compute all three functions.
Defining the series in a static inline function will let us call it with
input argument x or x +/- PI/2 for sine and cosine (depending on which of the
two series was chosen). For sincos, the function will be called twice: once
to obtain the cosines of the inputs and a second time to get the sines.
Doing that will allow us to maintain a single file which performs evaluations
for the three functions.
Any reason not to implement in this style?
Thanks.
Bert.