/* 26.09.2003, Volkmar Klatt email: CanisMaior@web.de or volkmar.klatt@stud.uni-bayreuth.de program that can produce two internal errors of GiNac 1.1.3 sent to ginac-bugs@ginac.de the following programs were used: * operating system: linux 2.4.20-18.9 * glibc-2.3.2-27.9 * compiler gcc 3.3.1 * GMP 4.1.2 (compiled with gcc 3.3.1, make check --> all tests passed) * CLN 1.1.5 (compiled with gcc 3.3.1, make check --> all tests passed) * GiNaC 1.1.3 (compiled with gcc 3.3.1, make check ---> 1 of 3 tests failed: ... examining series expansion.........../run_exams: line 3: 12967 segment fault ... What should I do? I really don't know! ------------------------------------------------------------------------- intention of that program: make symbolic and numerical derivation of a simple function. (I'll try to adapt a maple course with GiNaC) */ #include #include using namespace std; using namespace GiNaC; int main() { symbol x("x"); ex f = cos( pow(x, 2) ) - x/3; // Funktion cout << "1. symbolische Ableitung" << endl; ex fx = f.diff(x,1); cout << fx << endl; // Nun: Versuch, den numerischen Wert an der Stelle 1 auszugeben: // vgl. tutorial.ps S. 41 cout << "1. Ableitung an der Stelle 1" << endl; ex hilf1 = fx.subs( x == 1 ); numeric fx_n = ex_to(hilf1);// numerischer Wert, vgl. tutorial.ps S. 38 /* the following command breaks the program and gives the output: "Internal error: statement in file float/misc/cl_F_digits.cc, line 30 has been reached!! Please send the authors of the program a description how you produced this error!" */ cout << fx_n << endl; // comment out to see the second error /* the following command breaks the program and gives another output: Internal error: statement in file real/elem/cl_R_mul.cc, line 93 has been reached!! Please send the authors of the program a description how you produced this error! */ cout << evalf(fx_n) << endl; return 0; }