Is it possible to know if two python functions are functionally equivalent?
<p>Let's say I have two python functions <code>f</code> and <code>g</code>:</p>

<pre><code>def f(x):
    y = x**2 + 1
    return y

def g(x):
    a = x**2
    b = a + 1
    return b
</code></pre>

<p>These two functions are clearly functionally equivalent (both return <code>x**2 + 1</code>).</p>

<p>My definition of functionally equivalent is as follows:</p>

<p><strong>If two functions <code>f</code> and <code>g</code> always produce the same output given the same input, then <code>f</code> and <code>g</code> are functionally equivalent.</strong></p>

<p>Further, let's say no global variables are involved in <code>f</code> and <code>g</code>.</p>

<p>Is it possible to automatically determine (without human inspection) if python functions <code>f</code> and <code>g</code> are functionally equivalent?</p>