// Path: fast-ftrl-proximal/src/main/java/io/scaledml/core/util/Util.java
// public class Util {
//     private final static HashFunction murmur = Hashing.murmur3_128(42);
// 
//     private final static HashFunction murmur32 = Hashing.murmur3_32(17);
//     public static final double EPSILON = 0.0000001;
// 
//     public static boolean doublesEqual(double d1, double d2, double precision) {
//         if (!Doubles.isFinite(d1) || !Doubles.isFinite(d2)) {
//             return false;
//         }
//         return Math.abs(d1 - d2) < precision;
//     }
// 
//     public static boolean doublesEqual(double d1, double d2) {
//         return doublesEqual(d1, d2, EPSILON);
//     }
// 
//     public static HashFunction murmur() {
//         return murmur;
//     }
// 
//     public static HashFunction murmur32() {
//         return murmur32;
//     }
// 
//     public static boolean doublesLess(double v1, double v2) {
//         return v1 < v2 - EPSILON;
//     }
// }


import io.scaledml.core.util.Util;
import it.unimi.dsi.fastutil.doubles.*;
import java.util.Collections;
package io.scaledml.features;


public class Binning {
    private final DoubleList percentiles = new DoubleArrayList();

    public Binning addPercentile(double percentile) {
        percentiles.add(percentile);
        return this;
    }

    public Binning finishBuild() {
        percentiles.sort(Double::compare);
        for (int i = 0; i < percentiles.size() - 1; i++) {
// Path: fast-ftrl-proximal/src/main/java/io/scaledml/core/util/Util.java
// public class Util {
//     private final static HashFunction murmur = Hashing.murmur3_128(42);
// 
//     private final static HashFunction murmur32 = Hashing.murmur3_32(17);
//     public static final double EPSILON = 0.0000001;
// 
//     public static boolean doublesEqual(double d1, double d2, double precision) {
//         if (!Doubles.isFinite(d1) || !Doubles.isFinite(d2)) {
//             return false;
//         }
//         return Math.abs(d1 - d2) < precision;
//     }
// 
//     public static boolean doublesEqual(double d1, double d2) {
//         return doublesEqual(d1, d2, EPSILON);
//     }
// 
//     public static HashFunction murmur() {
//         return murmur;
//     }
// 
//     public static HashFunction murmur32() {
//         return murmur32;
//     }
// 
//     public static boolean doublesLess(double v1, double v2) {
//         return v1 < v2 - EPSILON;
//     }
// }


// Path: fast-ftrl-proximal/src/main/java/io/scaledml/features/Binning.java
import io.scaledml.core.util.Util;
import it.unimi.dsi.fastutil.doubles.*;
import java.util.Collections;

package io.scaledml.features;


public class Binning {
    private final DoubleList percentiles = new DoubleArrayList();

    public Binning addPercentile(double percentile) {
        percentiles.add(percentile);
        return this;
    }

    public Binning finishBuild() {
        percentiles.sort(Double::compare);
        for (int i = 0; i < percentiles.size() - 1; i++) {
            if (Util.doublesEqual(percentiles.getDouble(i), percentiles.getDouble(i + 1), 0.0001)) {