Barycentric rational interpolation and approximation with applications