## [Maxima-commits] CVS: maxima/tests rtest_gamma.mac, 1.7, 1.8 testsuite.lisp, 1.71, 1.72

 [Maxima-commits] CVS: maxima/tests rtest_gamma.mac, 1.7, 1.8 testsuite.lisp, 1.71, 1.72 From: Dieter Kaiser - 2008-09-29 13:46:23 ```Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7496 Modified Files: rtest_gamma.mac testsuite.lisp Log Message: Adding more tests for the function factorial(z). Remove test which give an expected error for gamma_incomplete(a,z) Adjust test for gamma_incomplete_regluarized(a-1,z). Because Maxima factors some parts of the result within the simplifier we get the expected and more readable result. Remove expected error from testsuite.lisp. Files: rtest_gamma.mac testsuite.lisp Index: rtest_gamma.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtest_gamma.mac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rtest_gamma.mac 28 Sep 2008 21:31:00 -0000 1.7 +++ rtest_gamma.mac 29 Sep 2008 13:46:10 -0000 1.8 @@ -107,12 +107,79 @@ factorial(-5/2); 4*sqrt(%pi)/3; -/* No simplifcation for infinities and undeterminates */ +/* Expansion for factorial(z+n) and integer n */ + +factorial_expand:true; +true; + +factorial(z+1); +(z+1)*factorial(z); + +factorial(z+2); +(z+1)*(z+2)*factorial(z); + +factorial(z+3); +(z+1)*(z+2)*(z+3)*factorial(z); + +factorial(z-1); +factorial(z)/z; + +factorial(z-1); +factorial(z)/z; + +factorial(z-2); +factorial(z)/(z*(z-1)); + +factorial(z-3); +factorial(z)/(z*(z-1)*(z-2)); + +/* Nested factorials simplifies too, see SF[1486452] */ + +factorial(factorial(n)/factorial(n-1)); +factorial(n); + +factorial(sin(factorial(n)/factorial(n-1))); +factorial(sin(n)); + +factorial_expand:false; +false; + +/* minfactorial does not do this job */ + +minfactorial(factorial(factorial(n)/factorial(n-1))); +factorial(factorial(n)/factorial(n-1)); + +/* factcomb is the inverse operation to minfactorial + factorial_expand has to be false +*/ + +factcomb((n+1)*(n+2)*(n+3)*n!); +(n+3)!; + +factcomb(n!/(n*(n-1)*(n-2))); +(n-3)!; + +/* No simplifcation for infinities and undeterminates + with the exception of inf: inf! -> inf */ map(factorial, [inf,minf,infinity,und,ind]); -[factorial(inf),factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; +[inf,factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; -/* some real values in double float and bigfloat precision */ +/* factlim is set to the value 100,000. This should work. */ + +fpprec:64; +64; + +relerror( + factorial(factlim), + factorial(bfloat(factlim)), + 1b-58); /* We loose a lost of digits in relerror */ +true; + +factorial(factlim+1); +factorial(100000+1); + +/* Some real values in double float and bigfloat precision */ fpprec:64; 64; @@ -1014,19 +1081,20 @@ fpprec:128; 128; -/* Problem 229: - We have a problem with this test. +/* We have a problem with this test. The result is equal up to about 90 digits. Not more. But for other arguments we can verify the result within the accuracy. Furthermore we can verify the calculation against the result of the evaluation of expintegral_e. So what is wrong? */ +/* Exlude this test for now closeto( gamma_incomplete(0.25b0,0.50b0), 0.55658041400942713438787175086206500916583389997764808415332643613122015052649897833312327325822333229784708198027750127190766504b0, 1.0b-124); true; +*/ /* Test against expintegral_e. This test work! */ closeto( @@ -1535,11 +1603,8 @@ gamma_incomplete_regularized(a+1,z); gamma_incomplete_regularized(a,z)+%e^(-z)*z^a/gamma(a+1); -/* The result is not as simple as expected because of the - ordering of terms which comes from the Pochhammer function. -*/ gamma_incomplete_regularized(a-1,z); -gamma_incomplete_regularized(a,z)+%e^(-z)*z^(a-1)*(1-a)/((a-1)*gamma(a)); +gamma_incomplete_regularized(a,z)-%e^(-z)*z^(a-1)/gamma(a); gamma_incomplete_regularized(1/2,z); erfc(sqrt(z)); Index: testsuite.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/tests/testsuite.lisp,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- testsuite.lisp 26 Sep 2008 20:35:36 -0000 1.71 +++ testsuite.lisp 29 Sep 2008 13:46:11 -0000 1.72 @@ -44,5 +44,5 @@ ((mlist) "rtest_map" 2 3 4) ((mlist) "rtest_sign" 21 25 30 40 62 63 65 72 77 79 84) ((mlist) "rtest_algebraic") - ((mlist) "rtest_gamma" 229) + "rtest_gamma" )) ```

 [Maxima-commits] CVS: maxima/tests rtest_gamma.mac, 1.7, 1.8 testsuite.lisp, 1.71, 1.72 From: Dieter Kaiser - 2008-09-29 13:46:23 ```Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7496 Modified Files: rtest_gamma.mac testsuite.lisp Log Message: Adding more tests for the function factorial(z). Remove test which give an expected error for gamma_incomplete(a,z) Adjust test for gamma_incomplete_regluarized(a-1,z). Because Maxima factors some parts of the result within the simplifier we get the expected and more readable result. Remove expected error from testsuite.lisp. Files: rtest_gamma.mac testsuite.lisp Index: rtest_gamma.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtest_gamma.mac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rtest_gamma.mac 28 Sep 2008 21:31:00 -0000 1.7 +++ rtest_gamma.mac 29 Sep 2008 13:46:10 -0000 1.8 @@ -107,12 +107,79 @@ factorial(-5/2); 4*sqrt(%pi)/3; -/* No simplifcation for infinities and undeterminates */ +/* Expansion for factorial(z+n) and integer n */ + +factorial_expand:true; +true; + +factorial(z+1); +(z+1)*factorial(z); + +factorial(z+2); +(z+1)*(z+2)*factorial(z); + +factorial(z+3); +(z+1)*(z+2)*(z+3)*factorial(z); + +factorial(z-1); +factorial(z)/z; + +factorial(z-1); +factorial(z)/z; + +factorial(z-2); +factorial(z)/(z*(z-1)); + +factorial(z-3); +factorial(z)/(z*(z-1)*(z-2)); + +/* Nested factorials simplifies too, see SF[1486452] */ + +factorial(factorial(n)/factorial(n-1)); +factorial(n); + +factorial(sin(factorial(n)/factorial(n-1))); +factorial(sin(n)); + +factorial_expand:false; +false; + +/* minfactorial does not do this job */ + +minfactorial(factorial(factorial(n)/factorial(n-1))); +factorial(factorial(n)/factorial(n-1)); + +/* factcomb is the inverse operation to minfactorial + factorial_expand has to be false +*/ + +factcomb((n+1)*(n+2)*(n+3)*n!); +(n+3)!; + +factcomb(n!/(n*(n-1)*(n-2))); +(n-3)!; + +/* No simplifcation for infinities and undeterminates + with the exception of inf: inf! -> inf */ map(factorial, [inf,minf,infinity,und,ind]); -[factorial(inf),factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; +[inf,factorial(minf),factorial(infinity),factorial(und),factorial(ind)]; -/* some real values in double float and bigfloat precision */ +/* factlim is set to the value 100,000. This should work. */ + +fpprec:64; +64; + +relerror( + factorial(factlim), + factorial(bfloat(factlim)), + 1b-58); /* We loose a lost of digits in relerror */ +true; + +factorial(factlim+1); +factorial(100000+1); + +/* Some real values in double float and bigfloat precision */ fpprec:64; 64; @@ -1014,19 +1081,20 @@ fpprec:128; 128; -/* Problem 229: - We have a problem with this test. +/* We have a problem with this test. The result is equal up to about 90 digits. Not more. But for other arguments we can verify the result within the accuracy. Furthermore we can verify the calculation against the result of the evaluation of expintegral_e. So what is wrong? */ +/* Exlude this test for now closeto( gamma_incomplete(0.25b0,0.50b0), 0.55658041400942713438787175086206500916583389997764808415332643613122015052649897833312327325822333229784708198027750127190766504b0, 1.0b-124); true; +*/ /* Test against expintegral_e. This test work! */ closeto( @@ -1535,11 +1603,8 @@ gamma_incomplete_regularized(a+1,z); gamma_incomplete_regularized(a,z)+%e^(-z)*z^a/gamma(a+1); -/* The result is not as simple as expected because of the - ordering of terms which comes from the Pochhammer function. -*/ gamma_incomplete_regularized(a-1,z); -gamma_incomplete_regularized(a,z)+%e^(-z)*z^(a-1)*(1-a)/((a-1)*gamma(a)); +gamma_incomplete_regularized(a,z)-%e^(-z)*z^(a-1)/gamma(a); gamma_incomplete_regularized(1/2,z); erfc(sqrt(z)); Index: testsuite.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/tests/testsuite.lisp,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- testsuite.lisp 26 Sep 2008 20:35:36 -0000 1.71 +++ testsuite.lisp 29 Sep 2008 13:46:11 -0000 1.72 @@ -44,5 +44,5 @@ ((mlist) "rtest_map" 2 3 4) ((mlist) "rtest_sign" 21 25 30 40 62 63 65 72 77 79 84) ((mlist) "rtest_algebraic") - ((mlist) "rtest_gamma" 229) + "rtest_gamma" )) ```