def sumUntilEpsilon(start: Double, epsilon: Double): Double = {
        var sum = 0.0
        var term = start
        /**
         * This loop continues to add terms until the absolute value of the term is less than epsilon.
         * The term is halved each iteration, simulating a converging series.
         */ 
        do {
            sum += term
            term /= 2.0
        } while (abs(term) > epsilon)
        sum
    }