Rounding differences between 1.8 and 1.7 (including -Xint mode).

Dawid Weiss dawid.weiss at gmail.com
Mon Jul 30 04:41:13 PDT 2012


Hi Vladimir,

This narrows down to Math.pow. I've tried with:

Java(TM) SE Runtime Environment, 1.8.0-ea-b49
Java HotSpot(TM) 64-Bit Server VM, 24.0-b16

and the output is still different to what it should be (I think):

Math.pow(0.35380219098726884, 0.2564102564102564) = 0.7661213560902934

whereas it should be:

0.7661213560902933

Simple test program attached.

Dawid

On Sat, Jul 21, 2012 at 12:16 AM, Vladimir Kozlov
<vladimir.kozlov at oracle.com> wrote:
> Dawid,
>
> It would be nice if you can provide a test case for us. What jdk8 build you
> are using?
>
> We recently changed implementation of exp() and pow() in VM on x86 from C
> code to use FPU instructions. It created a bugs tail. The latest bug 7177917
> was fixed in jdk8b48.
>
> Thanks,
> Vladimir
>
>
> Dawid Weiss wrote:
>>
>> Hi everyone.
>>
>> We observe test regressions on fairly complex computational code
>> resulting from small differences in double roundings. They show up
>> when executed with latest 1.8 snapshot (compared to 1.7 and 1.6). Also
>> applies when run in interpreted mode (-Xint).
>>
>> I was wondering if this is something to be expected? Thanks,
>>
>> Dawid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestPow.java
Type: application/octet-stream
Size: 587 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120730/973f0f8e/TestPow.java 


More information about the hotspot-compiler-dev mailing list