/**
 * Compare two tuples and return true if all elements are equal within epsilon tolerance, false otherwise.
 */
fun compareTuples(tuple1: List<Double>, tuple2: List<Double>, epsilon: Double): Boolean {

    if (tuple1.size != tuple2.size) {
        return false
    }

    for (i in tuple1.indices) {
        if (Math.abs(tuple1[i] - tuple2[i]) > epsilon) {
            return false
        }
    }

    return true
}
/**
 * Compare two tuples and return true if all elements are equal within epsilon tolerance, false otherwise.
 */
fun compareTuples(tuple1: List<Double>, tuple2: List<Double>, epsilon: Double): Boolean {
/**
 * Compare two tuples and return true if all elements are equal within epsilon tolerance, false otherwise.
 */
fun compareTuples(tuple1: List<Double>, tuple2: List<Double>, epsilon: Double): Boolean {

    if (tuple1.size != tuple2.size) {
        return false
    }

    for (i in tuple1.indices) {
        if (Math.abs(tuple1[i] - tuple2[i]) > epsilon) {
            return false
        }
    }

    return true
}