Roots and Singular Points of Semi-Analytic Functions