X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=cint%2Fexam_mansamples.cpp;h=b38122b529e04223f7e2542818831f98f5a28802;hp=d26ad3545c6236ce6c0b5c97ef24e8c6c60fbc19;hb=f54584fc4f72d28a070c26981a98fa34919ca455;hpb=0d9b6e6d134917a8fb5cf76ade55dcbaf01acb28 diff --git a/cint/exam_mansamples.cpp b/cint/exam_mansamples.cpp index d26ad354..b38122b5 100755 --- a/cint/exam_mansamples.cpp +++ b/cint/exam_mansamples.cpp @@ -1,15 +1,30 @@ #! ./run_exams --silent -int result = 0; +unsigned result = 0; symbol x("x"), y("y"), z("z"); { - ex a = pow(x,2)-x-2; - ex b = pow(x+1,2); - ex s = a/b; - if (!(s.diff(x)-2*pow(1+x,-3)*(-2-x+pow(x,2))-(-1+2*x)*pow(1+x,-2)).is_zero()) { - ++result; - } - if (!(s.normal()-(-2+x)/(1+x)).is_zero()) { - ++result; - } + ex a = pow(x,2)-x-2; + ex b = pow(x+1,2); + ex s = a/b; + if (!(s.diff(x)+2/pow(1+x,3)*(-2-x+pow(x,2))-(-1+2*x)/pow(1+x,2)).is_zero()) { + ++result; + } + if (!(s.normal()-(-2+x)/(1+x)).is_zero()) { + ++result; + } +} +//GiNaC-cint.function +ex EulerNumber(unsigned n) +{ + symbol xi; + const ex generator = pow(cosh(xi),-1); + return generator.diff(xi,n).subs(xi==0); +} +if (EulerNumber(42) != numeric("-10364622733519612119397957304745185976310201")) { + ++result; +} +ex f = expand((x*y*z-1)*(x*y*z+3)); +ex g = expand((x*y*z-1)*(x*y*z-3)); +if (gcd(f, g) != x*y*z-1) { + ++result; } exit(result);