This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: libevaluator library and GSL
On Fri, 2003-09-05 at 09:00, Kenneth Geisshirt wrote:
> Aleksandar B. Samardzic wrote:
>
> >>I'm only speaking for myself here: I'd like to have some of this
> >>functionality available,
>
> Me too. But I don't care whether it's a seperate library or not.
> Aleksandar: great initiative.
>
> >>Could you tell us more about what your evaluator does? How does it
> >>compute derivatives? Symbolically or numerically? Does it simplify
> >>formulas? Does it look for common subexpressions?
>
> I wrote a similar library about 10 years ago. Derivatives are not too
> difficult to implement, but the expressions become really ugly. Try to
> derive sin(x)^cos(x) w.r.t. x to see what I mean :-).
I have such a system in Numexp-core (http://numexp.sf.net), but as
Kenneth said, derivatives become very ugly.
>
> Simplifying expressions is a much harder job. Of course you can do
> simple things like (x-x) -> 0 and (1*x) -> x but (x+y)-x is not that easy.
I am doing some of these simple simplifications. Started writing a
better simplifier by patter matching in Perl. It gives some interesting
results, but is not a decent way.
>
> > My library is parsing string and creating tree representation of it in
> > memory.
>
> Tree representation is straight forward but might not be the most
> efficient representation. At least in the 1980's and 1990's I believe
> that most compilers used DAGs (Directed Acyclic Graphs). The Dragon book
> by Aho et al. outlines the algorithms.
I am using trees, too!
Alberto