Quick question about the sine function in Java. Does anyone know how the value is computed? I found this question about sin in Java, but that's asking why the sin function isn't wrapped in native code. I'm asking something entirely different. I want to know how the function was implemented. (Since it's wrapped in native code, I can't see it.)
Did they simply implement it from the Taylor series expansion:
sin(x) = x - (x^3)/3! + (x^5)/5! - O(x^7)
I can't look at the code for the Math.sine() function, since it gets wrapped up in native code.