Lpoly2   Distributed polynomials in series.

This branch contains the module lpoly which is a translation and adaptation of a part of my library rmpoly
(http://code.google.com/p/rmpoly/ ), and ltaylor.

lpoly uses distributed polynomials, described by dicts having as keys sympy monomials; values can be on an arbitrary ring,  provided the ring satisfies `ring(a) = a` for `a` in the ring, `ring(0) = 0`, `ring(1) = 1`

The main use is with the `QQ` ring or on sympy symbolic ring, see below;
let me mention a couple of examples for other rings

```
>>> from mpmath import mpf, mp
>>> from sympy.polys.monomialtools import lex
>>> from sympy.polys.lpoly import lgens
>>> lp, x = lgens('x', mpf, lex)
>>> mp.dps = 30
>>> (x*mpf('0.5')).exp('x', 6)
0.000260416666666666666666666666667*x**5 + 0.00260416666666666666666666666667*x**4 + 0.0208333333333333333333333333333*x**3 + 0.125*x**2 + 0.5*x + 1.0
```

example in noncommuting case

```
>>> from sympy import sympify
>>> from sympy.physics.quantum import Operator
>>> from sympy.polys.monomialtools import lex
>>> from sympy.polys.lpoly import nclgens
>>> lp, x = nclgens('x', sympify, lex)
>>> A = Operator('A')
>>> B = Operator('B')
>>> prec = 4
>>> pa = (x*A).exp('x', prec)
>>> pb = (x*B).exp('x', prec)
>>> p = pa.mul_trunc(pb, 'x', prec)
>>> p.log('x', prec).expand()
(-A*B*A/6 + A*B**2/12 + A**2*B/12 - B*A*B/6 + B*A**2/12 + B**2*A/12)*x**3 + (A*B/2 - B*A/2)*x**2 + (A + B)*x
```


In lpoly one can do series reversion

```
>>> from sympy.polys.monomialtools import lex
>>> from sympy.polys.lpoly import lgens
>>> from sympy.polys.domains import QQ
>>> lp, x, y = lgens('x, y', QQ, lex)
>>> prec = 10
>>> p = x.asin('x', prec) + x**7
>>> p.series_reversion('x', prec, 'y')
604801/362880*y**9 - 5041/5040*y**7 + 1/120*y**5 - 1/6*y**3 + y
```

Taylor expansion of elementary functions is pretty fast;
it follows the design of elementary functions in FLINT
(see http://fredrik-j.blogspot.com/2011/03/flint-example-lambert-w-function-power.html)
so that the cost of doing taylor expansions of functions of functions
(e.g. exp(sin(x)) ) is not much greater than the one for the functions themselves.

There is a class of expressions in which the Taylor expansion can
be done quite easily and fast. It consists of the functions in which
all basic operations are Taylor expandible, e.g. if there is an operation
`f/g`, `f` has a taylor expansion (no laurent term),
and `g` has a taylor expansion with constant term `g0`); then
`f/g + O(x**n) = f*(1/g0 - g/g0**2 + ...)`
Similar requirements for nth_root, etc.

`ltaylor.taylor` has a very dumb interpreter transforming `Mul`, `Pow`, and
the elementary functions in the corresponding operations in lpoly;
if along the translation it meets a term not satisfying the above conditions,
it raises `NotImplementedError`.
It starts with the `QQ` ring; if the computation fails, it passes to
the symbolic ring (SR) consisting of the sympy expressions not having the
series variable x in its atoms; if also that fails, it passes it to
the series method.
Since computations on `QQ` are much faster
than on SR, and those on SR are faster than using the series method,
the overhead of trying the computation in faster ways is small.

Not implemented (and passed to series method) the options start != 0, dir != '+' .

`taylor`has an extra argument `pol_pars` to treat faster polynomial variables, see example below.


With it issue 1038 is solved: computing sin(x)*cos(x) up to order 1000
is only 3x slower than computing sin(x).

All following examples run in a small fraction of a second.

```
>>> from sympy.polys.ltaylor import taylor
>>> x,y = symbols('x,y')
>>> p1 = taylor((1 + sin(x))**10000, x, 0, 10)
>>> p1 = taylor(sin(x)**10, x, 0, 30)
>>> p1 = taylor((1 + y*sin(x))**10000, x, 0, 10, pol_pars=[y])
```

In the last example, without the pol_pars option it is 700 time slower.

`taylor` can deal with a few cases beyond the class of those mentioned above

```
>>> p1 = taylor(1/((1 + sin(sin(sin(x))))/x), x, 0, 10)
>>> p1 = taylor(1/sqrt(1 + exp(y)*sin(x)**2), x, 0, 10)
>>> p1 = taylor(exp(x)/((1-cos(x))*tan(2*x+x**2)), x, 0, 20)
>>> p1 = taylor(log(sinh(x)/x + x**6/810)/(2*x), x, 0, 20)
>>> p1 = taylor(sqrt(sin(x)), x, 0, 50)
>>> p1 = taylor(log(sin(2*x)), x, 0, 50)
```

It can also deal with functions having a regular series expansion in sympy

```
>>> from sympy.polys.ltaylor import taylor
>>> p1 = taylor(log(sin(2*x)*erf(x)*sqrt(pi)), x, 0, 50, analytic=True)
```

This pull request comes from https://github.com/sympy/sympy/pull/295,
taking away the groebner part, and with some improvement.