AbsSeq._dvariance is correct?
Y. Srinivas Ramakrishna
y.s.ramakrishna at oracle.com
Sun Nov 28 01:48:08 PST 2010
Hi Narihiro --
Algebraically, the two forms are equivalent. Are you saying that the
floating point rounding error is worse in the one form than in the other?
On 11/27/2010 9:15 AM, Narihiro Nakamura wrote:
> Hi all.
> I read G1GC because I had an interest in it.
> I have one question. AbsSeq._dvariance is correct?
> Please read the following patche.
> diff -r beef35b96b81 src/share/vm/utilities/numberSeq.cpp
> --- a/src/share/vm/utilities/numberSeq.cpp Fri Oct 01 15:45:01 2010 -0700
> +++ b/src/share/vm/utilities/numberSeq.cpp Sun Nov 28 01:54:23 2010 +0900
> @@ -40,7 +40,7 @@
> // otherwise, calculate both
> _davg = (1.0 - _alpha) * val + _alpha * _davg;
> double diff = val - _davg;
> - _dvariance = (1.0 - _alpha) * diff * diff + _alpha * _dvariance;
> + _dvariance = (1.0 - _alpha) * (diff * diff) + _alpha * _dvariance;
> I'm sorry if it is misunderstand.
More information about the hotspot-gc-dev