Evaluating Functions
Evaluating a function means substituting a specific input value into the function to find the corresponding output.
Definition
Evaluating a function means substituting a specific input value, a number, variable, or algebraic expression, into the function's rule in place of the variable, computing $f(a)$ by replacing every occurrence of the variable with $a$. In type theory, evaluating $f(a)$ is beta-reduction, and in numerical analysis, evaluating complex functions efficiently (such as with Horner's method for polynomials) is a key concern for computational accuracy.
Example
If $f(x) = 5x - 2$, then $f(4) = 5(4) - 2 = 18$. Given $f(x) = 2x^2 - 3x + 1$: $f(-2) = 2(-2)^2 - 3(-2) + 1 = 15$, and $f(x + h) = 2x^2 + 4xh + 2h^2 - 3x - 3h + 1$. Horner's method evaluates $p(x) = a_n x^n + \ldots + a_0$ as $((\ldots((a_n x + a_{n-1})x + a_{n-2})x + \ldots + a_0)$, reducing $n^2$ multiplications to $n$.
Key Insight
Evaluating a function is just careful substitution, replace every $x$ with the input value, then simplify, respecting order of operations at every step. Evaluating $f(x + h)$ and simplifying $[f(x + h) - f(x)] / h$ is the foundation of the derivative in calculus, known as the difference quotient. Symbolic and numerical evaluation are distinct: symbolic evaluation manipulates expressions algebraically, while numerical evaluation produces floating-point approximations, each with trade-offs in precision and speed.