def init_legendre_rational(result, x, pos, cur_var):
    """Initialize the first and second order before starting the recursion.

    Mathematically this amounts to
    R_1 = (x-1)/(x+1)
    R_2 = 3/2 * (x-1)/(x+1)*P_1 - 1/2.

    .. note::

        The procedure on how an init function is built can be found in the
        docstring of the init function for
        standard polynomials *init_standard_poly*.


    :param result: Contains the observations along the first dimension
        and the function values of expansion w.r.t. an observation
        along the second dimension.
    :type result: numpy.ndarray

    :param x: The data to be expanded.
    :type x: numpy.ndarray

    :param pos: The index of the element to be computed, along the second
        dimension of result.
    :type int: int

    :param cur_var: The index of the current variable to be considered in the
        recursion. This value will have to be lower than x.shape[1].
    :type cur_var: int

    :returns: The index of the next element that will be computed in the
        recursion, the order of the next element, and the index of a special
        member. As we do not need a special element in Legendre rational 
        functions, the index of the special element is set to None.
    :rtype: Tuple[int, int, int]
    """
    result[:, (pos)] = (x[:, (cur_var)] - 1.0) / (x[:, (cur_var)] + 1.0)
    result[:, (pos + 1)] = 3.0 / 2.0 * (x[:, (cur_var)] - 1.0) / (x[:, (
        cur_var)] + 1.0) * result[:, (pos)] - 1.0 / 2.0
    return pos + 2, 3, None
