Weighted approximation of functions with inner singularities on the real line