/**
 * This function compares two lists element-wise and returns true if all elements are within the given epsilon value, otherwise false.
 *
 * @param list1 The first list to compare.
 * @param list2 The second list to compare.
 * @param epsilon The maximum allowed difference between corresponding elements in the lists.
 * @return true if all elements are within the epsilon value, false otherwise.
 */
fun compareLists(list1: List<Double>, list2: List<Double>, epsilon: Double): Boolean {

    if (list1.size != list2.size) {
        return false
    }

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

    return true
}
/**
 * This function compares two lists element-wise and returns true if all elements are within the given epsilon value, otherwise false.
 *
 * @param list1 The first list to compare.
 * @param list2 The second list to compare.
 * @param epsilon The maximum allowed difference between corresponding elements in the lists.
 * @return true if all elements are within the epsilon value, false otherwise.
 */
fun compareLists(list1: List<Double>, list2: List<Double>, epsilon: Double): Boolean {
/**
 * This function compares two lists element-wise and returns true if all elements are within the given epsilon value, otherwise false.
 *
 * @param list1 The first list to compare.
 * @param list2 The second list to compare.
 * @param epsilon The maximum allowed difference between corresponding elements in the lists.
 * @return true if all elements are within the epsilon value, false otherwise.
 */
fun compareLists(list1: List<Double>, list2: List<Double>, epsilon: Double): Boolean {

    if (list1.size != list2.size) {
        return false
    }

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

    return true
}