/**
 * This function compares two tuples based on a given epsilon value to handle floating-point errors.
 *
 * @param tuple1 First tuple containing floating-point values
 * @param tuple2 Second tuple containing floating-point values
 * @param epsilon Value to determine the acceptable error range
 * @return True if the tuples are equal within the specified epsilon range, False otherwise
 */
fun epsilonComparison(tuple1: DoubleArray, tuple2: DoubleArray, 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
}
/**
 * This function compares two tuples based on a given epsilon value to handle floating-point errors.
 *
 * @param tuple1 First tuple containing floating-point values
 * @param tuple2 Second tuple containing floating-point values
 * @param epsilon Value to determine the acceptable error range
 * @return True if the tuples are equal within the specified epsilon range, False otherwise
 */
fun epsilonComparison(tuple1: DoubleArray, tuple2: DoubleArray, epsilon: Double): Boolean {
/**
 * This function compares two tuples based on a given epsilon value to handle floating-point errors.
 *
 * @param tuple1 First tuple containing floating-point values
 * @param tuple2 Second tuple containing floating-point values
 * @param epsilon Value to determine the acceptable error range
 * @return True if the tuples are equal within the specified epsilon range, False otherwise
 */
fun epsilonComparison(tuple1: DoubleArray, tuple2: DoubleArray, 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
}