2/sqrt(2) doesn't simplify. Similarly for 2/2^(2/3).
On the other hand, x/sqrt(x) => sqrt(x).
And of course sqrt(2) simplifies to itself -- it doesn't
become 2/sqrt(2)!!
I believe the original examples should simplify to sqrt(2)
and 2^(1/3). Note that 2^(4/3) => 2*2^(1/3) (the current
behavior) is probably CORRECT, in order to make things
like 10^(10/3) intelligible.
Or is there something I'm missing?
Maxima 5.9.0 gcl 2.5.0 mingw32 Windows 2000 Athlon
Logged In: YES
user_id=570592
Try ratsimp with algebraic : true
(C1) z : 2/sqrt(2);
(D1) 2/SQRT(2)
(C2) ratsimp(z);
(D2) 2/SQRT(2)
(C3) ratsimp(z),algebraic;
(D3) SQRT(2)
(C4) z : 2/2^(2/3);
(D4) 2/2^(2/3)
(C5) ratsimp(z);
(D5) 2/2^(2/3)
(C6) ratsimp(z),algebraic;
(D6) 2^(1/3)
(C7)
Logged In: YES
user_id=588346
Yes, of course there are ways within Maxima to perform this
simplification. But it should be the default in the general
simplifer. The logic already appears to be in the general
simplifier, but there is a bug in this particular case. If the
general simplifier's philosophy were to leave such things
untouched, why does it simplify x/sqrt(x) and the like?
Logged In: YES
user_id=588346
More examples. Right-hand side is after ratsimp/algebraic. I
believe the general simplifier should be giving those forms.
1/(2*2^(2/3)) 2^(1/3)/4
1/2^(2/3) 2^(1/3)/2
1/(2*SQRT(2)) SQRT(2)/4
1/SQRT(2) SQRT(2)/2
1/(2*2^(1/3)) 2^(2/3)/4
1/2^(1/3) 2^(2/3)/2
Things get worse with non-numeric contents. In the
following, each group of expressions denotes the same thing,
but none simplifies to the others. I have put *** next to
those forms which are the results of ratsimp/algebraic. Note
that in several cases, there is more than one equivalent
ratsimp'ed form....
1/(a*b)^(5/2)
1/(a^2*b^2*SQRT(a*b)) ***
SQRT(a*b)/(a^3*b^3) ***
1/(a*b)^(3/2)
1/(a*b*SQRT(a*b)) ***
SQRT(a*b)/(a^2*b^2) ***
1/(a*b)^(7/6)
1/(a^(2/3)*b^(2/3)*SQRT(a*b)) ***
SQRT(a*b)/(a^(5/3)*b^(5/3)) ***
(a*b)^(5/6)/(a^2*b^2) ***
1/(a*b)^(5/6) ***
1/(a^(1/3)*b^(1/3)*SQRT(a*b)) ***
(a*b)^(1/6)/(a*b) ***
SQRT(a*b)/(a^(4/3)*b^(4/3)) ***
1/SQRT(a*b) ***
SQRT(a*b)/(a*b) ***
a^(1/3)*b^(1/3)/SQRT(a*b) ***
1/(a*b)^(1/6) ***
SQRT(a*b)/(a^(2/3)*b^(2/3)) ***
(a*b)^(5/6)/(a*b) ***
Now it is true that these expressions are in fact not all
equivalent as to principal value, but I will leave that exercise
for later. Many of them are, and they are not being
canonicalized.
Logged In: YES
user_id=588346
Originator: YES
I have raised the priority of this bug, because it is very close to the surface (i.e. easy for just about any user to run into). See also 1853191, where algebraic gives strange results...
Logged In: YES
user_id=1797506
Originator: NO
(%i6) (1/2)*sqrt(2);
(%o6) sqrt(2)/2
(%i7) sqrt(2)*(1/2);
(%o7) 1/sqrt(2)
Logged In: YES
user_id=28849
Originator: NO
The issue appears to be in timesin. The basic issue is that timesin isn't commutative, as dgildea shows.
I have a partial fix for this which fixes this particular issue, but it causes many failures in the testsuite, mostly due to a different ordering of the answer. But some tests now cause errors to be signaled, and some are no longer simplified as before or not simplified at all.
Bummer.
With revision 1.80 of simp.lisp the initial problem simplifies as expected:
(%i6) 2/sqrt(2);
(%o6) sqrt(2)
Furthermore we have:
(%i7) 1/sqrt(2)*2;
(%o7) sqrt(2)
(%i8) (1/2)*sqrt(2);
(%o8) 1/sqrt(2)
(%i9) sqrt(2)/2;
(%o9) 1/sqrt(2)
Closing this bug report as fixed.
Dieter Kaiser