]> www.ginac.de Git - ginac.git/blobdiff - check/exam_pseries.cpp
Happy new year!
[ginac.git] / check / exam_pseries.cpp
index 7ec803f88aa97fcd4d3dfa9c26660507bb475b9b..c1da8c46b61c785bd2f1bd8e70f2cb04ba4ff177 100644 (file)
@@ -3,7 +3,7 @@
  *  Series expansion test (Laurent and Taylor series). */
 
 /*
- *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -43,9 +43,15 @@ static unsigned exam_series1()
 {
        using GiNaC::log;
 
+       symbol a("a");
+       symbol b("b");
        unsigned result = 0;
        ex e, d;
        
+       e = pow(a+b, x);
+       d = 1 + Order(pow(x, 1));
+       result += check_series(e, 0, d, 1);
+
        e = sin(x);
        d = x - pow(x, 3) / 6 + pow(x, 5) / 120 - pow(x, 7) / 5040 + Order(pow(x, 8));
        result += check_series(e, 0, d);
@@ -119,11 +125,18 @@ static unsigned exam_series1()
        d = 1 + Order(pow(x, 2));
        result += check_series(e, 0, d, 2);
 
-       symbol a("a");
        e = pow(x, 4) * sin(a) + pow(x, 2);
        d = pow(x, 2) + Order(pow(x, 3));
        result += check_series(e, 0, d, 3);
 
+       e = log(a*x + b*x*x*log(x));
+       d = log(a*x) + b/a*log(x)*x - pow(b/a, 2)/2*pow(log(x)*x, 2) + Order(pow(x, 3));
+       result += check_series(e, 0, d, 3);
+
+       e = pow((x+a), b);
+       d = pow(a, b) + (pow(a, b)*b/a)*x + (pow(a, b)*b*b/a/a/2 - pow(a, b)*b/a/a/2)*pow(x, 2) + Order(pow(x, 3));
+       result += check_series(e, 0, d, 3);
+
        return result;
 }