# Finding optimal knots for function approximations

I would like to approximate a continuous (complex) function $$f(x)$$ in the interval $$[a,b]$$ $$(x\in\mathbb{R})$$ by local polynomial functions of order $$3$$ (cubic Hermite spline or cubic C2 spline).

Is there an efficient way to find the required number and "optimal" location of sampling points $$x_i$$, which result in a maximum error $$|\overline{f}(x)-f(x)|=\varepsilon$$?

I do not know if this question is too general, but the method should work for arbitrary continuous functions f(x). I would also be glad for literature suggestions, which can be handled by an engineer :).