def improvedeuleriteration(xi, yi, h, f):
    """Performs one iteration of Improved Euler's method.

    Args:
        xi (float): The previous x value
        yi (float): The previous y value
        h (float): The step size
        f (function): The derivative of y at That is, y' = f(x,y). f must be a defined before as function of x and y, in that order

    Returns:
        The next y value as a float
    """
    m1 = f(xi, yi)
    m2 = f(xi + h, yi + h * m1)
    return yi + h /2 * (m1 + m2)