to_poly_solve() bug?



ya at shvabra:~$ maxima
Maxima 5.28.0 http://maxima.sourceforge.net
using Lisp SBCL 1.0.40.0.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load("to_poly_solve")$

Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
STYLE-WARNING: redefining SIMP-ISREAL-P in DEFUN
(%i2) expr:2*E_M*m[a]*p[a]^2*E[a]*costheta*sqrt(m[1]^2*p[a]^2*costheta^2-m[1]^2*E[a]^2+E_M^2*m[a]^2)+(m[1]^2*p[a]^3*E[a]^2+E_M^2*m[a]^2*p[a]^3)*costheta^2-m[1]^2*p[a]*E[a]^4+E_M^2*m[a]^2*p[a]*E[a]^2$

(%i3) to_poly_solve(expr, costheta);
                                        E                E
                                         a                a
(%o3)             %union([costheta = - --], [costheta = --])
                                        p                p
                                         a                a
(%i4) assume(m[a]>0, E_M>0);
(%o4)                          [m>  0, E_M>  0]
                                  a
(%i5) to_poly_solve(expr, costheta);
                                                 E
                                                  a
(%o5)                      %union([costheta = - --])
                                                 p
                                                  a
(%i6)

It looks like that to_poly_solve() gives wrong solution E[a]/p[a] in (%o3). Is it really bug or some kind of feature?