Fwd: GiNaC error when trying to evaluate sin(x)^2 expression
Hi, When subsiting x by a float in a sin(x)^2 expression, I get the following error: libc++abi.dylib: terminating with uncaught exception of type cln::notreached_exception: Internal error: statement in file float/elem/cl_F_square.cc, line 21 has been reached!! using this code: symbol x; ex exTest = sin(x)*sin(x); exmap map; map[x] = 1.0; cout << exTest.subs(map) << endl; I need to do similar substitutions in a matrix, and they allways fail for expressions that contain cos(x)^2 or sin(x)^2, but no for ones that contain cos(x)*sin(x), for example. Can you help me understanding this error and/or getting around it? Regards
Hi,
On Sat, 21 Dec 2013 18:59:08 +0000, José Pontes <pontesjpc@gmail.com> said:
JP> symbol x; JP> ex exTest = sin(x)*sin(x); JP> exmap map; JP> map[x] = 1.0; JP> cout << exTest.subs(map) << endl; I tried your code and get the answer 0.70807341827357119353 The same output come out if the last line is written as: cout << exTest.subs(x==1.0) << endl; I am using GiNaC v.1.6.2 and cln v1.3.3 on Debian unstable Linux. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@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
participants (2)
-
José Pontes
-
Vladimir V. Kisil