]> www.ginac.de Git - ginac.git/blob - cint/exam_mansamples.cpp
- Some minor fixes.
[ginac.git] / cint / exam_mansamples.cpp
1 #! ./run_exams --silent
2 unsigned result = 0;
3 symbol x("x"), y("y"), z("z");
4 {
5     ex a = pow(x,2)-x-2;
6     ex b = pow(x+1,2);
7     ex s = a/b;
8     if (!(s.diff(x)+2/pow(1+x,3)*(-2-x+pow(x,2))-(-1+2*x)/pow(1+x,2)).is_zero()) {
9         ++result;
10     }
11     if (!(s.normal()-(-2+x)/(1+x)).is_zero()) {
12         ++result;
13     }
14 }
15 //GiNaC-cint.function
16 ex EulerNumber(unsigned n)
17 {
18     symbol xi;
19     const ex generator = pow(cosh(xi),-1);
20     return generator.diff(xi,n).subs(xi==0);
21 }
22 if (EulerNumber(42) != numeric("-10364622733519612119397957304745185976310201")) {
23     ++result;
24 }
25 ex f = expand((x*y*z-1)*(x*y*z+3));
26 ex g = expand((x*y*z-1)*(x*y*z-3));
27 if (gcd(f, g) != x*y*z-1) {
28     ++result;
29 }
30 exit(result);