Missing 1 in accumulating T?
qliang88 opened this issue · 1 comments
qliang88 commented
float test_T = __fmaf_rn(T, -alpha, T);
is different from float test_T = T * (1 - alpha);
in original implementation.
Maybe a typo?
MrNeRF commented
Hi,
you have T * (1 - alpha) = T - T * alpha = -T * alpha + T as integer addition is commutative.
With __fmaf_rn() you can compute three instructions in one cycle. __fmaf_rn() represent a * b + c
that is __fmaf_rn(-T, alpha,T) which also equals __fmaf_rn(T, -alpha,T).
Hope this helps!