dynamically switch between cubing and square + multiply