@Override
    public Sample clone() {
        Sample cpy = new Sample();
        cpy.x = new double[x.length];
        for (int i = 0; i < x.length; i++) {
            cpy.x[i] = x[i];
        }
        cpy.fx = fx;
        return cpy;
    }