add function "double calcError(double approx, double tv)"