docs: @Override
    public void put(double val, double weight) {
      if(weight <= 0) {
        return;
      }
      if(this.n == 0) {
        n = weight;
        min = max = val;
        sum = val * weight;
        m2 = m3 = m4 = 0;
        return;
      }
      final double nn = weight + this.n;
      final double deltan = val * this.n - this.sum;
      final double inc = deltan * weight;
  
      // Some factors used below:
      final double delta_nn = deltan / (this.n * nn);
      final double delta_nnw = delta_nn * weight;
      final double delta_nn2 = delta_nn * delta_nn;
      final double delta_nn3 = delta_nn2 * delta_nn;
      final double nb2 = weight * weight;
  
      final double tmp1 = this.n - weight;
      final double tmp2 = this.n * tmp1 + nb2;
      this.m4 += inc * delta_nn3 * tmp2 + 6. * nb2 * this.m2 * delta_nn2 - 4. * this.m3 * delta_nnw;
      this.m3 += inc * delta_nn2 * tmp1 - 3. * this.m2 * delta_nnw;
      this.m2 += inc * delta_nn;
      this.sum += weight * val;
      this.n = nn;
  
      min = val < min ? val : min;
      max = val > max ? val : max;
    }