]> www.ginac.de Git - ginac.git/blobdiff - check/exam_inifcns_nstdsums.cpp
Check for fixed bug in multiple polylogs.
[ginac.git] / check / exam_inifcns_nstdsums.cpp
index 8434fd1e699d28cd3cd1d69506f03b037bd5ddca..d0f6869effc033164f24f9d7a40e1764c4f2fe3e 100644 (file)
@@ -4,7 +4,7 @@
  *  functions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2008 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
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
-
+#include <iostream>
 #include <fstream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -287,24 +290,46 @@ static unsigned inifcns_test_LiG()
 }
 
 
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//  legacy exam - checking for historical bugs
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+static unsigned inifcns_test_legacy()
+{
+       Digits = 17;
+       ex prec = 5 * pow(10, -(int)Digits);
+
+       unsigned result = 0;
+
+       ex r1 = zeta(lst(1,1,1,1,1,1),lst(-1,-1,-1,1,1,1));
+       if ((r1.evalf() - numeric("-0.0012588769028204890704")) > prec) {
+               clog << "zeta({1,1,1,1,1,1},{-1,-1,-1,1,1,1}) seems to be wrong." << endl;
+               result++;
+       }
+
+       return result;
+}
+
+
 unsigned exam_inifcns_nstdsums(void)
 {
        unsigned result = 0;
        
        cout << "examining consistency of nestedsums functions" << flush;
-       clog << "----------consistency of nestedsums functions:" << endl;
        
        result += inifcns_test_zeta();
        result += inifcns_test_S();
        result += inifcns_test_HLi();
        result += inifcns_test_LiG();
-       
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
+       result += inifcns_test_legacy();
        
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_inifcns_nstdsums();
+}