Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083214 | emb-9 | Roland Westrelin | P3 | Resolved | Fixed | team |
JDK-8168165 | 8u152 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8163634 | 8u121 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8156727 | 8u112 | Cheleswer Sahu | P3 | Resolved | Fixed | b01 |
JDK-8159662 | 8u111 | Cheleswer Sahu | P3 | Resolved | Fixed | b01 |
JDK-8159659 | 8u102 | Cheleswer Sahu | P3 | Resolved | Fixed | b31 |
JDK-8158431 | 8u92 | Cheleswer Sahu | P3 | Resolved | Fixed | b32 |
JDK-8167741 | emb-8u121 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8162086 | emb-8u111 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8158920 | 7u121 | Shafi Ahmad | P3 | Resolved | Fixed | b01 |
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
FULL OS VERSION :
Linux host 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The function Math.pow() returns slightly different results upon repeated calls with exactly the same input parameters. It seems as if the implementation (floating point precision) is switched internally at some point during execution.
A mathematical function must return consistent and reproducible results within one VM instance.
also see http://stackoverflow.com/questions/26746623/math-pow-yields-different-results-upon-repeated-calls
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes
REGRESSION. Last worked in version 8u11
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the example code given below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
It should print nothing, but it prints:
Math.pow()
i=15573
x=2.862738293257239E7
p=2.8627382932572395E7
REPRODUCIBILITY :
This bug can be reproduced often.
---------- BEGIN SOURCE ----------
import java.util.function.BiFunction;
public class PowerTest {
private static final int N = 1000000;
private static final double base = 5350.456329377186;
private static final double exp = 2.0;
private static double eval(final BiFunction<Double, Double, Double> f) {
return f.apply(base, exp);
}
private void loop(final String s, final BiFunction<Double, Double, Double> f) {
double x = eval(f);
for (int i = 0; i < N; i++) {
final double p = eval(f);
if (x != p) {
System.out.println(s + "\ni=" + i + "\nx=" + x + "\np=" + p);
}
x = p;
}
}
public void mathPow() {
loop("Math.pow()", Math::pow);
}
public void strictMathPow() {
loop("StrictMath.pow()", StrictMath::pow);
}
public static void main(final String[] args) {
final PowerTest pt = new PowerTest();
pt.mathPow();
pt.strictMathPow();
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8083214 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8156727 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8158431 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8158920 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8159659 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8159662 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8162086 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8163634 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8167741 Math.pow yields different results upon repeated calls
-
- Resolved
-
-
JDK-8168165 Math.pow yields different results upon repeated calls
-
- Resolved
-
- relates to
-
JDK-8189172 Math.pow(base, 2.0) still broken.
-
- Open
-