Optimize math operation