Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## maxima-commits

 [Maxima-commits] CVS: maxima/share/numeric simpsn.mac,1.2,1.3 From: Robert Dodier - 2006-03-25 17:25:44 ```Update of /cvsroot/maxima/maxima/share/numeric In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16538/share/numeric Modified Files: simpsn.mac Log Message: Ensure that upper limit of summation is an integer. Index: simpsn.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/numeric/simpsn.mac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- simpsn.mac 13 Feb 2005 07:28:58 -0000 1.2 +++ simpsn.mac 25 Mar 2006 17:25:39 -0000 1.3 @@ -4,6 +4,7 @@ sum(apply(f,[a+(b-a)/n*i]),i,1,n-1))\$ simpson(f,a,b,n):= - (b-a)/n/3 * (apply(f,[a])+apply(f,[b]) + - 4*sum(apply(f,[a+(b-a)/n*(2*i-1)]),i,1,n/2) - + 2*sum(apply(f,[a+(b-a)/n*(2*i)]),i,1,(n-2)/2))\$ + block ([nn : ceiling (n / 2)], + (1/6)*(b-a)/nn * (apply(f,[a])+apply(f,[b]) + + 4*sum(apply(f,[a+(b-a)/(2*nn)*(2*i-1)]),i,1,nn) + + 2*sum(apply(f,[a+(b-a)/(2*nn)*(2*i)]),i,1,nn-1)))\$ ```