remove cmath dependency