def recf_chebyshev_poly(result, x, special, n, cur_var, pos):
    """Implementation of the recursion formula for Chebyshev polynomials
    of the first kind.
    The recursion formula is
    T_n = 2xT_{n-1} - T_{n-2}.

    .. note::

        The procedure on how an recursion function is built can be found in the
        docstring of the recursion function for
        standard polynomials *recf_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 special: Index of a special element to be considered in the
        recursion formula. The special element is the first
        Chebyshev polynomial of the current variable.
    :type special: int

    :param n: The order of the function to be computed at this step.
    :type n: 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

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

    :returns: The vectorized result (along the observations) of the
        n-th recursion step of the cur_var-th variable.
    :rtype: numpy.ndarray

    .. admonition:: Reference

        https://en.wikipedia.org/wiki/Chebyshev_polynomials
    """
    return 2.0 * x[:, (cur_var)] * result[:, (pos - 1)] - result[:, (pos - 2)]
