public int polyEval ( GrowQueue_I8 input , int x ) { int y = input . data [ 0 ] & 0xFF ; for ( int i = 1 ; i < input . size ; i ++ ) { y = multiply ( y , x ) ^ ( input . data [ i ] & 0xFF ) ; } return y ; }
Evaluate the polynomial using Horner s method . Avoids explicit calculating the powers of x .