docs: public static void cusum(double[] data, double[] out, int begin, int end) {
      assert (out.length >= data.length);
      // Use Kahan summation for better precision!
      // FIXME: this should be unit tested.
      double m = 0., carry = 0.;
      for(int i = begin; i < end; i++) {
        double v = data[i] - carry; // Compensation
        double n = out[i] = (m + v); // May lose small digits of v.
        carry = (n - m) - v; // Recover lost bits
        m = n;
      }
    }