test/java/lang/Math/Log1pTests.java

Print this page

        

*** 23,36 **** /* * @test * @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; --- 23,39 ---- /* * @test * @bug 4851638 4939441 * @summary Tests for {Math, StrictMath}.log1p + * @library /lib/testlibrary + * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils + * @run main Log1pTests * @author Joseph D. Darcy */ ! import static jdk.testlibrary.DoubleUtils.*; public class Log1pTests { private Log1pTests(){} static final double infinityD = Double.POSITIVE_INFINITY;
*** 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 --- 87,104 ---- failures += testLog1pCaseWithUlpDiff(testCases[i][0], testCases[i][1], 0); } // For |x| < 2^-54 log1p(x) ~= x ! for(int i = 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