BugFix: functions confused with exponent
Dear All, Currently the following code in GiNaC realsymbol x("x"); cout << (cos(x)/exp(x)).normal() << endl; prints value 1 with probability 50% (and the unmodified expression otherwise). I am attaching a one-line patch to fix this silly bug. Also I am attaching a previous patch which was not commented so far. The new method may be helpful from time to time but its equivalent in a user code would be much more involved due to the private nature of the relation class members. Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks
Dear Vladimir, Thanks for spotting this bug and for fixing it! I'm applying your patch. Also applying the second one about relational::canonical() function. (Sorry for the delay.) -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/> On 02.08.21 09:47, Vladimir V. Kisil wrote:
Dear All,
Currently the following code in GiNaC
realsymbol x("x"); cout << (cos(x)/exp(x)).normal() << endl;
prints value 1 with probability 50% (and the unmodified expression otherwise). I am attaching a one-line patch to fix this silly bug.
Also I am attaching a previous patch which was not commented so far. The new method may be helpful from time to time but its equivalent in a user code would be much more involved due to the private nature of the relation class members.
Best wishes, Vladimir
_______________________________________________ GiNaC-devel mailing list GiNaC-devel@ginac.de https://www.ginac.de/mailman/listinfo/ginac-devel
participants (2)
-
Richard B. Kreckel
-
Vladimir V. Kisil