move math functions into separate namespace