Having s
as sine of some (unknown) angle "a", what is the fastest way to get the "cosine of a"?
I know two obivious ways:
c = cos(asin(s));
and
c = sqrt(1 - s*s);
But I don't know how the implementation of the functions cos(), asin() and sqrt() compares to one another in regarding speed. How faster is one over another? Are there significant difference between their implementations in modern processors, say, between x86-64 and ARM with VFP? In the end, what is the better solution?
Edit: Since there are already 3 unrelated answers now, let me clarify: I don't initally have the angle, all I have is the sine. So there is no need to tell me to rotate the angle 90 degrees so I'll have the same value from the other function...