[GiNaC-list] GiNaC-list Digest, Vol 93, Issue 4

Vladimir V. Kisil kisilv at maths.leeds.ac.uk
Mon Sep 30 19:52:20 CEST 2013


>>>>> On Mon, 30 Sep 2013 17:50:07 +0200, Gunnar Birke <gunnar.birke at online.de> said:

    GB> But what if I have multiple functions, for example f(x) and g(x)
    GB> and some expression e that looks like f(2) + g(5) ... . Calling
    GB> e.subs(x==2) would bring great trouble. How can I distinguish
    GB> between the x in f(x) = 3*x+2 and the x in g(x) = 1/2*x-4, for
    GB> example.

    Let us start from the mathematical setup. If you need the function
  h(x)=f(x)+g(x) then you will not arrive to f(2)+g(5). If you really
  need the value f(2)+g(5), then it shall come from some natural
  mathematical setup either as (f(x)+g(y)).subs(lst(x==2,y==5)) or
  f(x).subs(x==2)+g(x).subs(x==5).

  Once more: GiNaC::function is designed for some purposes, which are
  different from value substitutions, GiNaC::ex can handle this simple
  task. 
-- 
Vladimir V. Kisil     email: kisilv at maths.leeds.ac.uk
                        www: http://www.maths.leeds.ac.uk/~kisilv/
Book: Geometry of Mobius Transformations
http://www.worldscientific.com/worldscibooks/10.1142/p835


More information about the GiNaC-list mailing list