I am using the IEEE754 half-precision floating point format, which has 11 significand bits.
My input is drawn randomly with values between 1.0 and 2.0.
I would like to approximate the maximum rounding error that could happen in the following computation.
(a1 + a2 + a3 + a4) * 0.25
I would only like to use units of least precision to calculate this rounding error.
Here's what I tried.
a1+a2 introduce rounding error
a1+a2+e1+a3 introduce rounding error
a1+a2+e1+a3+e2+a4 introduce rounding error
(a1+a2+e1+a3+e2+a4+e3)*0.25 introduce rounding error
The whole computation is
(a1+a2+e1+a3+e2+a4+e3)*0.25+e4 = ((a1+a2+a3+a4) + (e1+e2+e3))*0.25 + e4 = (a1+a2+a3+a4)*0.25 + (e1+e2+e3)*0.25 + e4
The rounding error is
(e1+e2+e3)*0.25 + e4.
e1 is about
e2 is about
e3 is about
e4 is about
So the maximum rounding error possible is then plugging these numbers in the total rounding error.
(e1+e2+e3)*0.25 + e4 = (0.5*ulp(4) + 0.5*ulp(6) + 0.5*ulp(8)) * 0.25 + 0.5*ulp(2)
I have several questions.
- Am I doing it the right way?
- Is there a way to over approximate the rounding error only by using one ulp and the number of operations?
- If this is not the recommended way, how should I go about approximating the maximum rounding error?
My application does not require extreme accuracy.
EDIT: forgot to multiply ulp by 0.5.