[Maxima] question about symbolic/numerical mixing
Martin Schönecker
ms_usenet at gmx.de
Fri Feb 20 02:11:16 CST 2009
Stavros Macrakis schrieb:
>
> (%i9) float:true$
> (%i10) resimplify(exprlist);
> (%o10) [-x,0.13616664909625,a*x]
> /* float flag controls %pi -> float */
Interestingly, I was not able to reproduce this output, with float:true,
still %pi remains the symbolic constant.
wxMaxima 0.8.1 http://wxmaxima.sourceforge.net
Maxima 5.17.1 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
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.
(%i24) kill(all);numer:false;float:false;
(%o0) done
(%o1) false
(%o2) false
(%i3) exprlist: [ abs(x), sin(%pi/23), x*a ]$
(%i4) resimplify(expr):= expand(expr,1,1);
(%o4) resimplify(expr):=expand(expr,1,1)
(%i5) resimplify(exprlist);
(%o5) [abs(x),sin(%pi/23),a*x]
(%i6) assume(x<0)$
(%i7) resimplify(exprlist);
(%o7) [-x,sin(%pi/23),a*x]
(%i8) numer:true$
(%i9) resimplify(exprlist);
(%o9) [-x,sin(0.043478260869565*%pi),a*x]
(%i10) float:true$ /* <<<<<<<<<<<<<<<<<<<<<<<<<<< */
(%i11) resimplify(exprlist);
(%o11) [-x,sin(0.043478260869565*%pi),a*x]
(%i12) assume(equal(a,0))$
(%i13) resimplify(exprlist);
(%o13) [-x,sin(0.043478260869565*%pi),a*x]
(%i14) a: 23$
(%i15) resimplify(exprlist);
(%o15) [-x,sin(0.043478260869565*%pi),a*x]
(%i16) ev(exprlist);
(%o16) [-x,0.13616664909625,23*x]
More information about the Maxima
mailing list