Subject: [ maxima-Bugs-609464 ] 1+%e,numer and %e^%e,numer
From: Harald Geyer
Date: Wed, 20 May 2009 22:47:36 +0200
Hi!
> Because we don't do the numerical evaluation for the symbol $%e in meval1,
> we
> have to check again every symbol in simplifya to get the desired consistent
> results.
I just wonder why numer is implemented the way it is and if we can come
up with something better ...
Currently there are quite some bugs/inconsistencies like in the following
example:
Maxima 5.18post http://maxima.sourceforge.net
Using Lisp CLISP 2.44.1 (2008-02-23)
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.
(%i1) display2d:false;
(%o1) false
(%i2) 1,numer;
(%o2) 1
(%i3) sin(0);
(%o3) 0
(%i4) sin(0), numer;
(%o4) 0.0
Note that numer is intended to return numerical but exact answers where
possible (hance %o2 seems correct) but %o4 is a float!
I wonder why numerical evaluation can't be performed from inner parts of
expressions to outer parts. i.e. in sin(%e^(%e+1)) first look at
%e+1, evaluate this to a float if numer=true, then look at %e^some_float
and always evaluate it, because it already is a float and finally look
at sin(some_other_float) ...
As an orthogonal issue: Why is numer a flag (I personally don't recall
ever setting it to true for anything beside tests, but I often use it
on the prompt like "foo, numer" but numer(foo) would work for me too).
If it wasn't a flag perhaps we wouldn't need to handle it in the
core simplifier.
HTH,
Harald