def f(x, a):
    """f(x) to solve. Assumes a 1D tensor of coefficients. E.g.
    [1.0, 2.0, 3.0] returns 1.0 + (2.0 * x) + (3.0 * (x ** 2))
    """
    result = 0
    
    for n in range(a.get_shape()[0]):
        result += a[n] * x ** n

    return result