test/java/lang/Math/Log1pTests.java
Print this page
*** 26,37 ****
* @bug 4851638 4939441
* @summary Tests for {Math, StrictMath}.log1p
* @author Joseph D. Darcy
*/
- import sun.misc.DoubleConsts;
-
public class Log1pTests {
private Log1pTests(){}
static final double infinityD = Double.POSITIVE_INFINITY;
static final double NaNd = Double.NaN;
--- 26,35 ----
*** 84,101 ****
failures += testLog1pCaseWithUlpDiff(testCases[i][0],
testCases[i][1], 0);
}
// For |x| < 2^-54 log1p(x) ~= x
! for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) {
double d = Math.scalb(2, i);
failures += testLog1pCase(d, d);
failures += testLog1pCase(-d, -d);
}
// For x > 2^53 log1p(x) ~= log(x)
! for(int i = 53; i <= DoubleConsts.MAX_EXPONENT; i++) {
double d = Math.scalb(2, i);
failures += testLog1pCaseWithUlpDiff(d, StrictMath.log(d), 2.001);
}
// Construct random values with exponents ranging from -53 to
--- 82,99 ----
failures += testLog1pCaseWithUlpDiff(testCases[i][0],
testCases[i][1], 0);
}
// For |x| < 2^-54 log1p(x) ~= x
! for(int i = DoubleUtils.MIN_SUB_EXPONENT; i <= -54; i++) {
double d = Math.scalb(2, i);
failures += testLog1pCase(d, d);
failures += testLog1pCase(-d, -d);
}
// For x > 2^53 log1p(x) ~= log(x)
! for(int i = 53; i <= Double.MAX_EXPONENT; i++) {
double d = Math.scalb(2, i);
failures += testLog1pCaseWithUlpDiff(d, StrictMath.log(d), 2.001);
}
// Construct random values with exponents ranging from -53 to