Update math_functions.cpp