3 ms·
> So we are really only calculating cosine from 0 to pi. You could go further and only to 0 to pi/2 as it is mirrored and flipped for pi/2 to pi. Or you could
by dheera 5y ago
> So we are really only calculating cosine from 0 to pi.
You could go further and only to 0 to pi/2 as it is mirrored and flipped for pi/2 to pi.
Or you could go even further and do only 0 to pi/4 and use a simple trig identity and your presumably parallely-developed sin function for the cos of pi/4 to pi.
> One of the implementations is nearly 3x faster than math.h
Is this true even for -O3?