docs: public float[] t4(float[] z, int k, int M) {
      float[] result = new float[M];
      float[] w = new float[z.length];
  
      for (int i = 0; i < z.length; i++) {
        w[i] = (float) 2.0 * (i + 1);
      }
  
      for (int i = 1; i <= M - 1; i++) {
        int head = (i - 1) * k / (M - 1) + 1;
        int tail = i * k / (M - 1);
        float[] subZ = subVector(z, head - 1, tail - 1);
        float[] subW = subVector(w, head - 1, tail - 1);
  
        result[i - 1] = (new Transformations()).rSum(subZ, subW);
      }
  
      int head = k + 1 - 1;
      int tail = z.length - 1;
      float[] subZ = subVector(z, head, tail);
      float[] subW = subVector(w, head, tail);
      result[M - 1] = (new Transformations()).rSum(subZ, subW);
  
      return result;
    }