## [Maxima-commits] CVS: maxima/tests rtest_gamma.mac,1.8,1.9

 [Maxima-commits] CVS: maxima/tests rtest_gamma.mac,1.8,1.9 From: Dieter Kaiser - 2008-09-30 13:12:08 ```Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8282 Modified Files: rtest_gamma.mac Log Message: Adding some tests for Double factorial. Tested with GCL 2.6.9 and CLISP 2.44. The testsuite has no problems. Index: rtest_gamma.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtest_gamma.mac,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- rtest_gamma.mac 29 Sep 2008 13:46:10 -0000 1.8 +++ rtest_gamma.mac 30 Sep 2008 13:11:58 -0000 1.9 @@ -344,6 +344,51 @@ Double factorial ******************************************************************************/ +/* Double factorial has mirror symmetry */ + +declare(z,complex); +done; + +conjugate(factorial_double(z)); +factorial_double(conjugate(z)); + +conjugate(factorial_double(x+%i*y)); +factorial_double(x-%i*y); + +/* No simplifcation for infinities and undeterminates + with the exception of inf: inf! -> inf */ + +map(factorial, [inf,minf,infinity,und,ind]); +[inf,factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; + +/* Test the expansion of Double factorial */ + +factorial_double(n+1); +factorial_double(n+1); + +factorial_double(n+2),factorial_expand:true; +(n+2)*factorial_double(n); + +factorial_double(n+3),factorial_expand:true; +factorial_double(n+3); + +factorial_double(n+4),factorial_expand:true; +(n+2)*(n+4)*factorial_double(n); + +factorial_double(n-1),factorial_expand:true; +factorial(n)/factorial_double(n); + +factorial_double(n-2),factorial_expand:true; +factorial_double(n)/n; + +factorial_double(n-3),factorial_expand:true; +factorial_double(n-3); + +factorial_double(n-4),factorial_expand:true; +factorial_double(n)/(n*(n-2)); + +/* Some small numbers */ + factorial_double(-3); -1; errcatch(factorial_double(-2)); @@ -581,10 +626,6 @@ 1e-13); true; -/* Complex Bigfloat does not work. We get only double float precision. - I have no idea why! Further work is needed. -*/ - closeto( factorial_double(-3.5b0+%i), (-0.0026442534512730229977827874410755514695008373007370518369259413b0 @@ -606,26 +647,6 @@ 1b-60); true; -/* This test shows that the Gamma function works for complex bigfloat */ - -closeto( - gamma(1+(3.3b0+%i)/2.0), - (1.2972549927172942677789338941981645022071299145741135508593106691b0 - + 0.5352362571886066062517362544937539933942267771249551706160092774b0*%i), - 1b-62); -true; - -/* Test the expansion of Double factorial */ - -factorial_double(n-1),factorial_expand:true; -factorial(n)/factorial_double(n); - -factorial_double(n+2),factorial_expand:true; -(n+2)*factorial_double(n); - -factorial_double(n-2),factorial_expand:true; -factorial_double(n)/n; - /****************************************************************************** Gamma function ******************************************************************************/ ```

 [Maxima-commits] CVS: maxima/tests rtest_gamma.mac,1.8,1.9 From: Dieter Kaiser - 2008-09-30 13:12:08 ```Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8282 Modified Files: rtest_gamma.mac Log Message: Adding some tests for Double factorial. Tested with GCL 2.6.9 and CLISP 2.44. The testsuite has no problems. Index: rtest_gamma.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtest_gamma.mac,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- rtest_gamma.mac 29 Sep 2008 13:46:10 -0000 1.8 +++ rtest_gamma.mac 30 Sep 2008 13:11:58 -0000 1.9 @@ -344,6 +344,51 @@ Double factorial ******************************************************************************/ +/* Double factorial has mirror symmetry */ + +declare(z,complex); +done; + +conjugate(factorial_double(z)); +factorial_double(conjugate(z)); + +conjugate(factorial_double(x+%i*y)); +factorial_double(x-%i*y); + +/* No simplifcation for infinities and undeterminates + with the exception of inf: inf! -> inf */ + +map(factorial, [inf,minf,infinity,und,ind]); +[inf,factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; + +/* Test the expansion of Double factorial */ + +factorial_double(n+1); +factorial_double(n+1); + +factorial_double(n+2),factorial_expand:true; +(n+2)*factorial_double(n); + +factorial_double(n+3),factorial_expand:true; +factorial_double(n+3); + +factorial_double(n+4),factorial_expand:true; +(n+2)*(n+4)*factorial_double(n); + +factorial_double(n-1),factorial_expand:true; +factorial(n)/factorial_double(n); + +factorial_double(n-2),factorial_expand:true; +factorial_double(n)/n; + +factorial_double(n-3),factorial_expand:true; +factorial_double(n-3); + +factorial_double(n-4),factorial_expand:true; +factorial_double(n)/(n*(n-2)); + +/* Some small numbers */ + factorial_double(-3); -1; errcatch(factorial_double(-2)); @@ -581,10 +626,6 @@ 1e-13); true; -/* Complex Bigfloat does not work. We get only double float precision. - I have no idea why! Further work is needed. -*/ - closeto( factorial_double(-3.5b0+%i), (-0.0026442534512730229977827874410755514695008373007370518369259413b0 @@ -606,26 +647,6 @@ 1b-60); true; -/* This test shows that the Gamma function works for complex bigfloat */ - -closeto( - gamma(1+(3.3b0+%i)/2.0), - (1.2972549927172942677789338941981645022071299145741135508593106691b0 - + 0.5352362571886066062517362544937539933942267771249551706160092774b0*%i), - 1b-62); -true; - -/* Test the expansion of Double factorial */ - -factorial_double(n-1),factorial_expand:true; -factorial(n)/factorial_double(n); - -factorial_double(n+2),factorial_expand:true; -(n+2)*factorial_double(n); - -factorial_double(n-2),factorial_expand:true; -factorial_double(n)/n; - /****************************************************************************** Gamma function ******************************************************************************/ ```