|
|
|
|
|
by nathell
1702 days ago
|
|
Interesting approach with the polynomials! I wonder whether the performance of that one can be improved – while the coefficients aren’t integer, they become integer when multiplied by 3. So I wonder whether evaluating a whole-coefficient polynomial (using Horner’s scheme) and dividing by 3 at the end (which the compiler might optimize to a multiplication) might provide a speed boost: unsigned char poly_encode_2(const unsigned char dibit) {
return (27 + x * (14 + x * (-18 + x * 7))) / 3;
}
Haven’t measured. |
|