Math context and function replacement macros