[GiNaC-list] arithmetic error on concat two expressions

Kraus Philipp philipp.kraus at flashpixx.de
Fri Aug 6 18:55:04 CEST 2010


Am 06.08.2010 um 17:53 schrieb Alexei Sheplyakov:

> Hi,
>
> On Fri, Aug 06, 2010 at 01:26:29PM +0200, Kraus Philipp wrote:
>
>> That's nice, but not my thinking, because the expressions are
>> std::string data, that can be set by a user, so I can't use your
>> example.
>
> Correct. But you don't need to parse "(t - formula)^2/2", instead you
> can construct the expression directly:

I can't construct it directly, because the error function can be  
changed, so in my template class it must be a little bit dynamic.


>> The Problem is, that my formula a*x^3 + b*y^4 (*) not correct
>> substitute into the other formula:
>
> What makes you think so? As far as I understand (t - a*x^3 - b*y^4)^2
> is the same as (a*x^3 + b*y^4 - t)^2

I'm now a little bit confused, cause I'm working for a long time with  
this problem and I don't see my "thinking error".
If I have an expression eg exp(x), so (t-exp(x))^2 is not the same  
(exp(x)-t)^2. Sorry I don't see it

Thanks

Phil


More information about the GiNaC-list mailing list