This version is natively vectorized; thus, it does not need a helper function. It also avoids unnecessary, repeated evaluations of the constant values that result from bitwShiftL, which were replaced by powers of two. As a result, execution becomes roughly a hundred times faster than the original version. Finally, we use the ternary conditional for increased readability. :)
This version is natively vectorized; thus, it does not need a helper function. It also avoids unnecessary, repeated evaluations of the constant values that result from bitwShiftL, which were replaced by powers of two. As a result, execution becomes roughly a hundred times faster than the original version. Finally, we use the ternary conditional for increased readability. :)