Well, it depends what "interval" wants to express.
[0.0, 4.0] is correct in the sense that all values that lie in x their
square lies in [0.0, 4.0]. Maybe it is not the closest interval that is
possible. Given that the implementation of interval(a,b) rounds up and
down accordingly, your patch should be safe.
Ralf