The real number 4/3 is not representable in double precision (or any other binary floating-point format) because it is not a dyadic rational. Thus, when you compute 4/3
in MATLAB, the value you get is rounded to the closest representable double-precision number, which is exactly:
1.3333333333333332593184650249895639717578887939453125
Subtracting 1 from this value is exact (it is a well-known theorem of FP error-analysis that subtracting numbers within a factor of two of each other is exact), so the result of 4/3 - 1
is:
0.3333333333333332593184650249895639717578887939453125
It happens that the result of multiplying this number by three is also exactly representable:
0.9999999999999997779553950749686919152736663818359375
Finally, subtracting from 1.0 is also exact (by the theorem I referenced earlier):
0.0000000000000002220446049250313080847263336181640625
So there is only a single source of rounding error in your computation, owing to the fact that 4/3 cannot be represented as a double, and the final result of the computation is simply that initial error carried forward.