Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions test/jdk/java/lang/Math/HyperbolicTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@

/*
* @test
* @key randomness
* @bug 4851625 4900189 4939441
* @library ../ /test/lib
* @build Tests
* @build HyperbolicTests
* @run main HyperbolicTests
* @summary Tests for {Math, StrictMath}.{sinh, cosh, tanh}
* @summary Tests for {Math, StrictMath}.{sinh, cosh, tanh} (use -Dseed=X to set PRNG seed)
*/

import static java.lang.Double.longBitsToDouble;
import java.util.Random;
import jdk.test.lib.RandomFactory;

public class HyperbolicTests {
private HyperbolicTests(){}
Expand Down Expand Up @@ -979,9 +982,10 @@ static int testTanh() {
*
*/
static int testTanhIntrinsicWithReference() {
// Transition boundaries for libm tanh intrinsic.
double b1 = 0.02;
double b2 = 5.1;
double b3 = 55 * Math.log(2)/2; // ~19.062
double b3 = 19.0615474654; // 55 * ln(2)/2

int failures = 0;

Expand All @@ -999,7 +1003,7 @@ static int testTanhWithReferenceInRange(double min, double range) {

double [] testCases = new double[500];

Random rand = new Random(0);
Random rand = RandomFactory.getRandom();
for (int i = 0; i < testCases.length; i++) {
testCases[i] = min + range * rand.nextDouble();
}
Expand Down