8302027: Port fdlibm trig functions (sin, cos, tan) to Java

Reviewed-by: bpb
This commit is contained in:
Joe Darcy 2023-03-04 23:52:03 +00:00
parent 9fdbf3cfc4
commit 1bb39a95eb
7 changed files with 2293 additions and 22 deletions

View file

@ -127,7 +127,9 @@ public final class StrictMath {
* @param a an angle, in radians.
* @return the sine of the argument.
*/
public static native double sin(double a);
public static double sin(double a) {
return FdLibm.Sin.compute(a);
}
/**
* Returns the trigonometric cosine of an angle. Special cases:
@ -139,7 +141,9 @@ public final class StrictMath {
* @param a an angle, in radians.
* @return the cosine of the argument.
*/
public static native double cos(double a);
public static double cos(double a) {
return FdLibm.Cos.compute(a);
}
/**
* Returns the trigonometric tangent of an angle. Special cases:
@ -151,7 +155,9 @@ public final class StrictMath {
* @param a an angle, in radians.
* @return the tangent of the argument.
*/
public static native double tan(double a);
public static double tan(double a) {
return FdLibm.Tan.compute(a);
}
/**
* Returns the arc sine of a value; the returned angle is in the