code: public static void Forward(double[] data) {
          double[] result = new double[data.length];
  
          for (int k = 0; k < result.length; k++) {
              double sum = 0;
              for (int n = 0; n < data.length; n++) {
                  double theta = ((2.0 * Math.PI) / data.length) * k * n;
                  sum += data[n] * cas(theta);
              }
              result[k] = (1.0 / Math.sqrt(data.length)) * sum;
          }
  
          for (int i = 0; i < result.length; i++) {
              data[i] = result[i];
          }
  
      }
docs: 1-D Forward Discrete Hartley Transform.
  
  @param data Data.