Error bounds for functional approximation and estimation using mixtures of experts