Optimal Estimation of Smooth Functions from Inaccurate Data