sympy/sympy — pull request #7978 by pbrady (2014-09-04 19:53:11+00:00)
Title: cache autowrap

cache results of autowrap following discussion of #7973.

Sample session:

```python
In [1]: from sympy.utilities.autowrap import autowrap

In [2]: from sympy import (
symbols, lambdify, sqrt, sin, cos, tan, pi, atan, acos, acosh, Rational,
Float, Matrix, Lambda, exp, Integral, oo, I, Abs, Function, true, false)

In [3]: w, x, y, z = symbols('w,x,y,z')

In [4]: expr = sin(x) + cos(y) + tan(z)**2 + Abs(z-y)*acos(sin(y*z)) + \
Abs(y-z)*acosh(2+exp(y-x))- sqrt(x**2+I*y**2)

In [5]: %time bin = autowrap(expr)
CPU times: user 100 ms, sys: 14 ms, total: 114 ms
Wall time: 1.12 s

In [6]: bin(1, 2, 3)
Out[6]: 2.9323081800586097

In [7]: %time bin = autowrap(expr)
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 41.7 µs

In [8]: bin(1, 2, 3)
Out[8]: 2.9323081800586097
```