question: public static boolean floatArrayEquals ( float [ ] x , float [ ] y , float tol ) { for ( int i = 0 ; i < x . length ; i += 1 ) { if ( x [ i ] == 0 ) { return y [ i ] == 0 ; } if ( Math . abs ( ( y [ i ] - x [ i ] ) / x [ i ] ) > tol ) { return false ; } } return true ; }
target:  Compare two float arrays using a given tolerance 