Here you can find the source of subtract(final double[] vector1, final double[] vector2)
public static double[] subtract(final double[] vector1, final double[] vector2)
//package com.java2s; //License from project: Apache License public class Main { public static double[] subtract(final double[] vector1, final double[] vector2) { assert (vector1.length == vector2.length); final double[] result = new double[vector1.length]; for (int i = 0; i < vector1.length; i++) { result[i] = vector1[i] - vector2[i]; }/*from ww w .j a v a 2 s . c om*/ return result; } }