Math functions and functors for numerical computations