We prove a very general theorem concerning the estimation of the expression ||T((a+b)/2) - (Ta+Tb)/2|| for different kinds of maps T satisfying some general perturbed isometry condition. It can be seen as a quantitative generalization of the classical Mazur-Ulam theorem. The estimates improve the existing ones for bi-Lipschitz maps. As a consequence we also obtain a very simple proof of the result of Gevirtz which answers the Hyers-Ulam problem and we prove a non-linear generalization of the Banach-Stone theorem which improves the results of Jarosz and more recent results of Dutrieux and Kalton.