public static void minus ( double [ ] y , double [ ] x ) { if ( x . length != y . length ) { throw new IllegalArgumentException ( String . format ( "Arrays have different length: x[%d], y[%d]" , x . length , y . length ) ) ; } for ( int i = 0 ; i < x . length ; i ++ ) { y [ i ] -= x [ i ] ; } }
Element - wise subtraction of two arrays y = y - x .