gnuradio
gnuradio copied to clipboard
Come up with consequence for HAVE_SINCOS not making much sense
we check whether STL has ::sincos. Sounds like something the C++ standard settles for us already, or at least a feature check macro.
yeah, sincos is a GNU extension, but it's actually slower than calling sin and cos separately. On clang, it's at least faster than that :)
on GCC, res = std::polar(1, angle); c = res.real(); s = res.imag(); is faster than sincos(angle, &c, &s) by about a factor of 30%, on clang, polar is 80% slower than sincos.
But on both, s = sin(angle); c = sqrt(1 - s * s); is faster, and thanks to trigonometric pythagoras, that's the same for reasonably behaved values. (and for $|s| < 2^{-48}$ I don't think we care that much.)