code: private double normalize(int d, double val) {
      d = (mean.length == 1) ? 0 : d;
      return (val - mean[d]) / stddev[d];
    }
docs: Normalize a single dimension.
  
  @param d Dimension
  @param val Value
  @return Normalized value