commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <sebastien.bris...@m4x.org>
Subject Re: [Math] x + h - x != h
Date Thu, 17 Nov 2011 19:36:07 GMT
Hi,

Also, it is clear that (x+delta) - x != delta for
> some values of delta so I doubt that the optimization happens.
>
>
Is there a specification where this is clearly stated ? I am actually
strugggling to find what kind of optimizations are performed by --say--
Oracle's JVM. One reason for this would be this issue, another would be: is
it possible to write the code in a way that would "help" the JIT (for
example to remove array bounds checks, and so on). If anyone could share
any hint about this, I would be grateful.

Regarding Gilles's issue. If we were to define a private *class variable*
called dummy, then I think the JIT would *have to compute* dummy
{code}
dummy = x + h;
h = dummy - x;
{code}

Now, this is not a perfect solution, because for the proposed (static)
method representableDelta, the class variable dummy woud need to be static
as well, which I think raises thread-safety issues? Do you think a solution
can be worked along those lines?

Thank you beforehand,
S├ębastien

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message