The xcoeffs array only has 100 elements and thus accessing xcoeffs[100] leads to undefined behaviour.