-
Bug
-
Resolution: Unresolved
-
P4
-
22
-
aarch64
-
os_x
The classjava.lang.Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions. The numeric methods of class java.lang.StrictMath are defined to return the bit-for-bit same results on all platforms. The implementations of the equivalent functions in class java.lang.Math do not have this requirement. This relaxation permits better-performing implementations where strict reproducibility is not required. By default most of the java.lang.Math methods simply call the equivalent method in java.lang.StrictMath for their implementation. Code generators (like C2) are encouraged to use platform-specific native libraries or microprocessor instructions, where available, to provide higher-performance implementations of java.lang.Math methods. Such higher-performance implementations still must conform to the specification for java.lang.Math
Running JMH benchmarks show that Math.tan is 15% slower than StrictMath.tan on macosx-aarch64
To reproduce:
cp BenchmarkMath.java test/micro
CONF=macosx-aarch64 make build-microbenchmark
CONF=macosx-aarch64 make TEST="micro:BenchmarkMath"
Benchmark Mode Cnt Score Error Units
Math.tan thrpt 5 83206.079 ± 846.826 ops/ms
StrictMath.tan thrpt 5 97560.239 ± 1424.875 ops/ms
See also JDK-8308776, JDK-8308775, JDK-8308774, JDK-8308773.
Running JMH benchmarks show that Math.tan is 15% slower than StrictMath.tan on macosx-aarch64
To reproduce:
cp BenchmarkMath.java test/micro
CONF=macosx-aarch64 make build-microbenchmark
CONF=macosx-aarch64 make TEST="micro:BenchmarkMath"
Benchmark Mode Cnt Score Error Units
Math.tan thrpt 5 83206.079 ± 846.826 ops/ms
StrictMath.tan thrpt 5 97560.239 ± 1424.875 ops/ms
See also JDK-8308776, JDK-8308775, JDK-8308774, JDK-8308773.