test/java/lang/Math/Expm1Tests.java
Print this page
*** 26,37 ****
* @bug 4851638 4900189 4939441
* @summary Tests for {Math, StrictMath}.expm1
* @author Joseph D. Darcy
*/
- import sun.misc.DoubleConsts;
-
/*
* The Taylor expansion of expxm1(x) = exp(x) -1 is
*
* 1 + x/1! + x^2/2! + x^3/3| + ... -1 =
*
--- 26,35 ----
*** 97,107 ****
for(double d = 37.5; d <= 709.5; d += 1.0) {
failures += testExpm1CaseWithUlpDiff(d, StrictMath.exp(d), 2, null);
}
// For x > 710, expm1(x) should be infinity
! for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) {
double d = Math.scalb(2, i);
failures += testExpm1Case(d, infinityD);
}
// By monotonicity, once the limit is reached, the
--- 95,105 ----
for(double d = 37.5; d <= 709.5; d += 1.0) {
failures += testExpm1CaseWithUlpDiff(d, StrictMath.exp(d), 2, null);
}
// For x > 710, expm1(x) should be infinity
! for(int i = 10; i <= Double.MAX_EXPONENT; i++) {
double d = Math.scalb(2, i);
failures += testExpm1Case(d, infinityD);
}
// By monotonicity, once the limit is reached, the
*** 114,124 ****
for(double d = -36.75; d >= -127.75; d -= 1.0) {
failures += testExpm1CaseWithUlpDiff(d, -1.0, 1,
reachedLimit);
}
! for(int i = 7; i <= DoubleConsts.MAX_EXPONENT; i++) {
double d = -Math.scalb(2, i);
failures += testExpm1CaseWithUlpDiff(d, -1.0, 1, reachedLimit);
}
// Test for monotonicity failures near multiples of log(2).
--- 112,122 ----
for(double d = -36.75; d >= -127.75; d -= 1.0) {
failures += testExpm1CaseWithUlpDiff(d, -1.0, 1,
reachedLimit);
}
! for(int i = 7; i <= Double.MAX_EXPONENT; i++) {
double d = -Math.scalb(2, i);
failures += testExpm1CaseWithUlpDiff(d, -1.0, 1, reachedLimit);
}
// Test for monotonicity failures near multiples of log(2).