/**
 * Given two lists t1 and t2, where each list contains floating-point numbers, this function aims to concatenate them
 * while avoiding floating-point error, using a small epsilon value.
 *
 * @param t1 The first list containing floating-point numbers
 * @param t2 The second list containing floating-point numbers
 * @return The resulting concatenated list without floating-point error
 */
fun floatListConcatenation(t1: List<Double>, t2: List<Double>): List<Double> {

    val epsilon = 1e-10  // Small epsilon value to avoid floating-point error
    val concatList = mutableListOf<Double>()

    concatList.addAll(t1)

    // Check if the last element of t1 is very close to the first element of t2
    if (Math.abs(t1.last() - t2.first()) < epsilon) {
        t2.drop(1)  // Exclude the first element of t2 to avoid duplication
    }

    concatList.addAll(t2)

    return concatList
}
/**
 * Given two lists t1 and t2, where each list contains floating-point numbers, this function aims to concatenate them
 * while avoiding floating-point error, using a small epsilon value.
 *
 * @param t1 The first list containing floating-point numbers
 * @param t2 The second list containing floating-point numbers
 * @return The resulting concatenated list without floating-point error
 */
fun floatListConcatenation(t1: List<Double>, t2: List<Double>): List<Double> {
/**
 * Given two lists t1 and t2, where each list contains floating-point numbers, this function aims to concatenate them
 * while avoiding floating-point error, using a small epsilon value.
 *
 * @param t1 The first list containing floating-point numbers
 * @param t2 The second list containing floating-point numbers
 * @return The resulting concatenated list without floating-point error
 */
fun floatListConcatenation(t1: List<Double>, t2: List<Double>): List<Double> {

    val epsilon = 1e-10  // Small epsilon value to avoid floating-point error
    val concatList = mutableListOf<Double>()

    concatList.addAll(t1)

    // Check if the last element of t1 is very close to the first element of t2
    if (Math.abs(t1.last() - t2.first()) < epsilon) {
        t2.drop(1)  // Exclude the first element of t2 to avoid duplication
    }

    concatList.addAll(t2)

    return concatList
}