docs: public static MutableDoubleTuple reverse(
          DoubleTuple t, MutableDoubleTuple result)
      {
          result = validate(t, result);
          if (t == result)
          {
              int n = t.getSize();
              int nh = n / 2;
              for (int i = 0; i < nh; i++)
              {
                  double temp = result.get(i);
                  result.set(i, result.get(n - 1 - i));
                  result.set(n - 1 - i, temp);
              }
          }
          else
          {
              int n = t.getSize();
              for (int i = 0; i < n; i++)
              {
                  result.set(i, t.get(n - 1 - i));
              }
          }
          return result;
      }