fix slope computation at singularity point, add smaller integration step when near singularity point, speedup AddSwitchPoint2 with binary search, fix bug in remove discontinuous switch points, increase step thresh near singularity point