rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

2*2^k doesn't simplify #1586

Closed rtoy closed 2 days ago

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:18:03 Created by macrakis on 2005-12-19 16:41:34 Original: https://sourceforge.net/p/maxima/bugs/844


a*a^k => a^(k+1) OK but 2*2^k => 2*2^k ???

Is this intentional behavior (under control of one of our wonderfully obscure switches)? Or a bug?

Maxima 5.9.2 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:18:05 Created by nobody on 2006-01-30 22:36:00 Original: https://sourceforge.net/p/maxima/bugs/844/#2272


Logged In: NO

May be subst(2,a,a*a^k);

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:18:08 Created by rtoy on 2006-04-27 14:04:01 Original: https://sourceforge.net/p/maxima/bugs/844/#19aa


Logged In: YES user_id=28849

As far as I can tell, there is no switch, obscure or otherwise, to control this. It's an oversight in the code. See simp.lisp version 1.20, which fixes this case, and also handles some others like 3/4*2^k.

There are still other issues like 2*3*2^k is 6*2^k instead of 3*2^(k+1).

I'm closing this bug as fixed, and adding a new bug.