That depends upon what information you are given about the function f. If you have no information at all about f, then it is quite possible that f takes on values of, say 100000000000 for some x between -1 and 1, -100000000 for some other value of x between -1 and 1, and the error as large. On the other hand, if you know that fisa quadratic polynomial, then the formula you got is exact!