code: public float[] normalise(float[] z) {
      float[] result = new float[z.length];
  
      for (int i = 0; i < z.length; i++) {
        float bound = (float) 2.0 * (i + 1);
        result[i] = z[i] / bound;
        result[i] = correctTo01(result[i]);
      }
  
      return result;
    }
docs: Normalizes a vector (consulte wfg toolkit reference)