code: public static MutableDoubleTuple rescaleElements(
          DoubleTuple t, double oldMin, double oldMax,
          double newMin, double newMax, MutableDoubleTuple result)
      {
          double invDelta = 1.0 / (oldMax - oldMin);
          double newRange = newMax - newMin;
          double scaling = invDelta * newRange;
          return DoubleTupleFunctions.apply(
              t, (a)->(newMin + (a - oldMin) * scaling), result);
      }
docs: Rescale the elements of the given tuple, so that the specified
  old range is mapped to the specified new range.
  
  @param t The input tuple
  @param oldMin The old minimum value
  @param oldMax The old maximum value
  @param newMin The new minimum value
  @param newMax The new maximum value
  @param result The tuple that will store the result
  @return The result tuple
  @throws IllegalArgumentException If the given tuples do not
  have the same {@link Tuple#getSize() size}