+#include <iostream>
+#include <vector>
+using namespace std;
+
+static unsigned test(unsigned n)
+{
+ matrix hilbert(n,n);
+
+ for (unsigned r=0; r<n; ++r)
+ for (unsigned c=0; c<n; ++c)
+ hilbert.set(r,c,numeric(1,r+c+1));
+ ex det = hilbert.determinant();
+
+ /*
+ The closed form of the determinant of n x n Hilbert matrices is:
+
+ n-1 / \
+ ----- | pow(factorial(r),3) |
+ | | | ------------------- |
+ | | | factorial(r+n) |
+ r = 0 \ /
+ */
+
+ ex hilbdet = 1;
+ for (unsigned r=0; r<n; ++r)
+ hilbdet *= pow(factorial(r),3)/(factorial(r+n));
+
+ if (det != hilbdet) {
+ clog << "determinant of " << n << "x" << n << " erroneously returned " << det << endl;
+ return 1;
+ }
+ return 0;
+}
+
+unsigned time_lw_H()