[GiNaC-devel] Normal on nested functions

Ladislav Zejda lzejda at gmail.com
Wed Mar 11 00:26:40 CET 2015


Dear developers,

first let me thank you for the excellent job you are doing.


Recently I have found out a problem during the computation of the numerator
and the denominator of expressions involving nested functions. A simple
example is enclosed in the file  test_normal.cc . Output of the program
linked against the current git repository or the version 1.6.3 is in the
file  test_normal.log . Though the denominator of both terms is the same,
the program returns the square of it.

I looked into the source code. Seem like functions
replace_with_symbol(const ex & e, exmap & repl, exmap & rev_lookup)  and
replace_with_symbol(const ex & e, exmap & repl)   defined in the file
normal.cpp search repl for an original expression but insert into repl
alredy substitued expression. Then the repeated search does not work and a
new symbol is introduced.
I tried to fix it with the enclosed patch normal.cpp.patch. Is it
acceptable as a solution of the problem?

Best regards,
                       Ladislav Zejda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20150311/d546ac49/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_normal.cc
Type: text/x-c++src
Size: 570 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20150311/d546ac49/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_normal.log
Type: text/x-log
Size: 162 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20150311/d546ac49/attachment.log>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: normal.cpp.patch
Type: text/x-patch
Size: 2050 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20150311/d546ac49/attachment.patch>


More information about the GiNaC-devel mailing list