Artifact 5c0ff9f283bd85dfba73073fbeb9da39ad3da8692fbc3ae64d77f8076f4546c1:
- Executable file
r37/packages/alg/fac.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1154) [annotate] [blame] [check-ins using] [more...]
- Executable file
r38/packages/alg/fac.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1154) [annotate] [blame] [check-ins using]
module fac; % Support "factor" as an operator. % Author: Anthony C. Hearn. global '(!*micro!-version); symbolic procedure factor u; if !*micro!-version then factor0 u else factor1(u,t,'factors!*); symbolic procedure factor0 u; begin scalar oldexp,v,w; if cdr u or kernp (v := simp!* car u) then <<lprim "Please use FAC instead"; return factor1(u,t,'factors!*)>>; oldexp := !*exp; !*exp := t; if null oldexp then v := resimp v; w := !*fcfm2f fctrf numr v ./ !*fcfm2f fctrf denr v; if null oldexp then !*exp := oldexp; % if w = u or w = v then return u % else if null oldexp then return mk!*sq w % else return list('!*sq,w,nil) return mk!*sq w end; flag('(factor),'intfn); symbolic procedure !*fcfm2f u; % converts factored form u to standard form. multf(car u,!*fcfm2f1 cdr u); symbolic procedure !*fcfm2f1 u; if null u then 1 else multpf(mksp(caar u,cdar u),!*fcfm2f1 cdr u); symbolic procedure expandd u; reval u where !*exp = t; flag('(expandd),'opfn); flag('(expandd),'noval); endmodule; end;