FW: The combine method



 From: shinabe.munehiro at hotmail.co.jp
To: willisb at unk.edu
Subject: RE: [Maxima] The combine method
Date: Tue, 7 May 2013 10:41:05 +0900








 
From: willisb at unk.edu
To: shinabe.munehiro at hotmail.co.jp; maxima at math.utexas.edu
Subject: RE: [Maxima] The combine method
Date: Mon, 6 May 2013 12:39:33 +0000

I wiil try it again!
 
inverse_additive(e,f) :=
subst("+" =
 lambda([[l]],
  block([listarith : true, q : 0, lx, r:0,farg : false],
   for  lx in l  do (
    if not mapatom(lx) and op(lx)=f then (farg : true,lx : args(lx),q : q +lx) else (r:r+lx,farg : false)
   ),
   if farg then funmake(f, inverse_additive(q,f))+r else q+r
  )
 ),
e)$







f(f(5*y))+f(f(x))+3;
inverse_additive(%,f);
 
f(f(5*y+x))+3
 
 
inverse_additive(1+x,f);
 
x+1
 
 
Part Marty