some unrolling of math macros for more compact footprint