code: public static double reduce(
          DoubleTuple t0, double identity, DoubleBinaryOperator op)
      {
          double result = identity;
          int n = t0.getSize();
          for (int i=0; i<n; i++)
          {
              double operand0 = t0.get(i);
              result = op.applyAsDouble(result, operand0);
          }
          return result;
      }
docs: Performs a reduction on the elements of the given tuple, using the
  provided identity value and an associative accumulation function,
  and returns the reduced value.
  
  @param t0 The tuple
  @param identity The identity value
  @param op The accumulation function
  @return The result