Arbitrary Precision Quadrature Functions Added to Ch.8 Maxima by Example
Subject: Arbitrary Precision Quadrature Functions Added to Ch.8 Maxima by Example
From: Barton Willis
Date: Sat, 17 Nov 2012 15:41:17 +0000
Let S be the intersection of the cylinders x^2 + z^2 < 1 and y^2 + z^2 < 4. Let's compute volume(S) using:
(i) numerical quadrature and Ted's code:
(%i30) fpprec : 97$
(%i32) v1 : apnint(4 * sqrt(1-x^2)*sqrt(4-x^2),x,-1,1,80,90);
(%o32) 1.21603199053831874596552819283058651286634990891354275741019108734603734811168687842711453b1
(ii) hand calculation of the antiderivative (a Gauss hypergeometric) and numerical evaluation
(%i33) v2 : nfloat(4*%pi * hypergeometric([-1/2,1/2],[2],1/4),[],80);
(%o33) 1.2160319905383187459655281928305865128663499089135427574101910873460373481116869b1
And compare :)
(%i34) v1-v2;
(%o34) 3.090794501435045958046918478475175622067054689750797600513921211676626755520312554236263611465723b-79
--Barton