(5-e^x).substitute(x=log(x)) goes wrong?

5 views
Skip to first unread message

KvS

unread,
Sep 10, 2010, 11:10:45 AM9/10/10
to sage-support
Dear all,

I'm sorry I have yet again something to bother you with. Running the
following few lines:

eq=5-e^x
print "1:",eq.substitute(x=3*x)
print "2:",eq.substitute(x=log(x))

yields the output (Sage 4.5.2 with Ubuntu):

1: -e^(3*x) + 5
2: -log(x) + 5

So 1 is fine, but it seems that to get to 2 Sage actually substitutes
twice no: 5-e^x -> 5-x -> 5-log(x). I had expected it would just give
me 5-x rather, is it a bug or a feature?

Thanks again, Kees

Burcin Erocal

unread,
Sep 10, 2010, 3:55:35 PM9/10/10
to sage-s...@googlegroups.com
Hi Kees,

Thanks for reporting the problem.

This looks like a bug in GiNaC, the library we use for the symbolic
expressions.

ginsh - GiNaC Interactive Shell (ginac V1.5.7)
__, _______ Copyright (C) 1999-2010 Johannes Gutenberg University
Mainz, (__) * | Germany. This is free software with ABSOLUTELY
NO WARRANTY. ._) i N a C | You are welcome to redistribute it under
certain conditions. <-------------' For details type `warranty;'.

Type ?? for a list of help topics.
> subs(5-exp(x),x==log(x));
5-log(x)


I opened a ticket for this:

http://trac.sagemath.org/sage_trac/ticket/9891


Cheers,
Burcin

KvS

unread,
Sep 10, 2010, 4:17:23 PM9/10/10
to sage-support
Ok, thanks!
Reply all
Reply to author
Forward
0 new messages