I had a look at the bug report "horner([...],x)/FIX" - ID: 631216.
As suggested in the bug report I have tried the following
implementations of the functions $ratnumer, $ratdenom and taych2rat:
(defmfun $ratnumer (x)
(cond ((mbagp x)
(cons (car x) (mapcar '$ratnumer (cdr x))))
(t
(setq x (taychk2rat x))
(cons (car x) (cons (cadr x) 1)))))
(defmfun $ratdenom (x)
(cond ((mbagp x)
(cons (car x) (mapcar '$ratdenom (cdr x))))
(t
(setq x (taychk2rat x))
(cons (car x) (cons (cddr x) 1)))))
(defun taychk2rat (x)
(cond ((and ($ratp x)
(member 'trunc (cdar x) :test #'eq))
($taytorat x))
(t ($rat x))))
With this changes $ratnumer and $ratdenom map over lists, matrices and
equations. The function $horner will map over these bags too.
We get the expected mapping over lists and equations:
(%i4) horner(x^2+x=a*x^2+b*x);
(%o4) x*(x+1) = x*(a*x+b)
(%i5) horner([x^2+x,x^3+x,x^4+x]);
(%o5) [x*(x+1),x*(x^2+1),x*(x^3+1)]
In addition ratnumer and ratdenom map over lists too:
(%i6) ratnumer([x^2/y^2+x,(x^3+x)/(y^2+y),(x^4+x)/(y^3+y^2)]);
(%o6) [x*y^2+x^2,x^3+x,x^4+x]
(%i7) ratdenom([x^2/y^2+x,(x^3+x)/(y^2+y),(x^4+x)/(y^3+y^2)]);
(%o7) [y^2,y^2+y,y^3+y^2]
The testsuite and share_testsuite has no problems.
I think it is useful to implement the mapping over lists and equations.
This can be done at more places too.
Any comments?
Dieter Kaiser