RFR: 8308776: [AArch64] Math.log is 10% slower than StrictMath.log on aarch64

Joe Darcy darcy at openjdk.org
Tue Nov 18 21:49:45 UTC 2025


On Thu, 13 Nov 2025 20:41:56 GMT, Dhamoder Nalla <dhanalla at openjdk.org> wrote:

> This PR Introduces an optimized AArch64 intrinsic for Math.log using reciprocal refinement and a table-driven polynomial.
> Improves throughput for double logarithms while preserving IEEE-754 corner case behavior (±0, subnormals, negatives, NaN).

test/jdk/java/lang/Math/TestLogMinValue.java line 40:

> 38:         }
> 39:         if (mathLog != strictLog) {
> 40:             throw new AssertionError("Mismatch: Math.log=" + mathLog + " StrictMath.log=" + strictLog);

Is this assertion justified by the Math.log specification?

test/jdk/java/lang/Math/TestLogMonotonicity.java line 29:

> 27:  * @run main TestLogMonotonicity
> 28:  */
> 29: public class TestLogMonotonicity {

So the test is checking for monotonicity over value that are 2X the previous value?

That is a very weak test.

In other math library regression tests we test for monotonicity on successive values.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28306#discussion_r2539695976
PR Review Comment: https://git.openjdk.org/jdk/pull/28306#discussion_r2539698410


More information about the hotspot-dev mailing list