Improving approximations to real-valued functions using statistical ideas