RFR: JDK-8316708: Augment WorstCaseTests with more cases

Raffaello Giulietti rgiulietti at openjdk.org
Fri Sep 22 15:36:15 UTC 2023


On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> A new paper
> 
>  "Accuracy of Mathematical Functions in Single, Double, Double Extended, and Quadruple Precision"
> by Brian Gladman, Vincenzo Innocente and Paul Zimmermann
> https://members.loria.fr/PZimmermann/papers/accuracy.pdf
> 
> details the inputs with generate the worst-case observed errors in different math library implementations. The FDLIBM-related worst cases should be added to the test suite.

test/jdk/java/lang/Math/WorstCaseTests.java line 230:

> 228: 
> 229:             // Worst-case observed error
> 230:             {-0x1.004d1c5a9400bp-1,    -0x1.0c6e322e8a28cp-1},

It seems that the exact value y meets `-0x1.0c6e322e8a28cp-1` < y < `-0x1.0c6e322e8a28bp-1`, and is closer to `-0x1.0c6e322e8a28bp-1`.
Thus, the correctly rounded result is `-0x1.0c6e322e8a28bp-1`.
The truncated (expected) value should be `-0x1.0c6e322e8a28bp-1` as well.

test/jdk/java/lang/Math/WorstCaseTests.java line 293:

> 291: 
> 292:             // Worst-case observed error
> 293:             {-0x1.0068b067c6feep-1,     +0x1.0c335e2f0727p1},

Similar considerations as for asin above.
The "expected" value should be `0x1.0c335e2f0726fp1`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15879#discussion_r1334537273
PR Review Comment: https://git.openjdk.org/jdk/pull/15879#discussion_r1334539144


More information about the core-libs-dev mailing list