code: double refined_vector_value(SparseVector composite, SparseVector vec, int sign)
      {
          double sum = 0.0;
          for (Map.Entry<Integer, Double> entry : vec.entrySet())
          {
              sum += Math.pow(entry.getValue(), 2) + sign * 2 * composite.get(entry.getKey()) * entry.getValue();
          }
          return sum;
      }
docs: c^2 - 2c(a + c) + d^2 - 2d(b + d)
  
  @param composite (a+c,b+d)
  @param vec       (c,d)
  @param sign
  @return