[GiNaC-list] converting expressions to double

Jens Vollinga jens.vollinga at googlemail.com
Fri Mar 2 21:11:48 CET 2012


Hi,

could you run your code with an added extra line like the following:

...
	ex = ex.subs(lst(x == _x, y == _y, z == _z, u == _u));
	ex = ex.evalf();
	std::cout << tree << ex << std::endl;  /* NEW NEW NEW */
	numeric tmp = ex_to<numeric>(ex);
...

and report about the result? That would help pin down the problem.

Regards,
Jens



On 02.03.2012 15:41, Tomasz I. Rudny wrote:
> Hi,
>
> Thanks for quick reply. I am afraid this is not the case. My dbgprint()
> of my expression looks like this (many iterations given here):
>
> 4.760311310558623545
> -0.4959608476010454472
> 0.83221034995653497086
> 1.5383241757249394564
> -0.31180539644482394346
> 3.5366695187408772796
> 0.6577950130788717955
> 1.776523528073554051
> 2.3553448973345405323
> -1.4278829682706838499
> -3.1344162711667552658
> -8.88682924942704566
>
> Any suggestions?
>
> Kind Regards,
> Tomasz
>
> W dniu 02.03.2012 12:07, Vladimir V. Kisil pisze:
>> 		Hi, Tomasz,
>>
>> 		One of the common reasons for such problem is that your
>>    expression still contains some variables. Make a debug print of it and
>>    check if it is the case.
>>
>>    Good luck!
>>    Vladimir
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-list



More information about the GiNaC-list mailing list