The code is applying a bias (shift) to inputs which is wrong. The index in case 2 should be i + 2 not i + 4. We can simplify the code a little and remove the if statement, reducing 7 lines to 3 in each of the 3 cases. The testcase works with the patch, and fails without. The patch reduces GCC C testsuite failures from 2174 to 2108 (-66). Jim