Hi,
On Wed, Mar 03, 2010 at 10:28:04AM -0800, smichr wrote:
> If you have a polynomial in x and you replace x with a polynomial in u
> you might end up with something that doesn't factor in the traditional
> sense, but finding the roots of it should be quite trivial, e.g.
> factor((1+2*x + x**3).s
VERY helpful--thank you! Regarding the simplification issue, I ran
this little script to show how much larger the roots are than they
apparently have to be:
###
p = -2 + 5*x**3 - 3*x**6 + x**9
tru = solve(p, x)
d = decompose(p, x)
p2roots=solve(d[1]-a,x)
p1roots=solve(d[0],x)
ans=[]
for p2 in p2ro
Here's a draft of a Horner routine...any ideas where this might go?
rewrite?
def _horner(p, x, n=0):
"""recursive helper for horner."""
pow, co = p.TM[0], p.TC
if pow == co == 0:
return 0
else:
t = co * Pow(x, pow)
return Pow(x, pow - n)*(co + _horner(p -
Hi,
On Mon, Mar 08, 2010 at 08:43:42AM -0800, smichr wrote:
> Here's a draft of a Horner routine...any ideas where this might go?
> rewrite?
>
> def _horner(p, x, n=0):
> """recursive helper for horner."""
>
> pow, co = p.TM[0], p.TC
> if pow == co == 0:
> return 0
> els
On Mon, Mar 8, 2010 at 8:43 AM, smichr wrote:
> Here's a draft of a Horner routine...any ideas where this might go?
> rewrite?
>
> def _horner(p, x, n=0):
> """recursive helper for horner."""
>
> pow, co = p.TM[0], p.TC
> if pow == co == 0:
> return 0
> else:
> t = co *