int x = n / 3; // <-- make this faster // for instance int a = n * 3; // <-- normal integer multiplication int b = (n << 1) + n; // <-- potentiall
See How To Divide By 3 for an extended discussion of more efficiently dividing by 3, focused on doing FPGA arithmetic operations.
Also relevant: