[SciPy-user] polynomial division problems

David M.Cooke cookedm at physics.mcmaster.ca
Thu Dec 22 13:06:04 CST 2005


On Dec 21, 2005, at 15:12 , Ted Horst wrote:

> Polynomial division seems not to be working for me:
>
>>>> import scipy
>>>> scipy.__core_version__
> '0.8.6.1693'
>>>> x2m1 = scipy.poly1d([1,0,-1])
>>>> xp1 = scipy.poly1d([1,1])
>>>> xm1 = scipy.poly1d([1,-1])
>>>> x2m1/xp1
>
> hangs, it seems the args in polydiv are backwards, so:

Yes, this is bad :) I'm working on it.

>>>> xp1/x2m1
> [poly1d([ 0.]), poly1d([1, 1])]
>
> but even with args reversed, this should be poly1d([1, -1])

eh? (x+1)/(x**2-1) should have a quotient of 0, and a remainder of x+1.

-- 
|>|\/|<
/------------------------------------------------------------------\
|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca



More information about the SciPy-user mailing list