An active triangle is, as in DCUTRI, dissected into four congruent triangles by ... two or four parallelograms by lines running parallel to the sides as in Figure 3.
Algorithm 764: Cubpack11: A C11 Package for Automatic Two-Dimensional Cubature RONALD COOLS Katholieke Universiteit Leuven DIRK LAURIE Potchefstroomse Universiteit vir Christelike Hoe¨r Onderrig and LUC PLUYM Katholieke Universiteit Leuven
In this article, software for the numerical approximation of double integrals over a variety of regions is described. The software was written in C11. Classes for a large number of shapes are provided. A global adaptive integration algorithm is used based on transformations and subdivisions of regions. Categories and Subject Descriptors: D.3.2 [Programming Languages]: Language Classifications—C11; G.1.4 [Numerical Analysis]: Quadrature and Numerical Differentiation— adaptive quadrature; multiple quadrature; G.4 [Mathematics of Computing]: Mathematical Software—efficiency; reliability and robustness General Terms: Algorithms Additional Key Words and Phrases: Automatic integration, cubature, planar regions
1. INTRODUCTION The problem of computing an integral in two dimensions is much more complex than its one-dimensional counterpart. A glance at the contents pages of Stroud’s pioneering work [Stroud 1971] is enough to make one realize that the shape of the integration region plays a dominant part in the design of cubature formulas, and the survey [Cools and Rabinowitz Authors’ addresses: R. Cools, Department of Computer Science, Katholieke Universiteit Leuven, Celestijnenlaan 200A, B-3001 Heverlee, Belgium; D. Laurie, Department of Mathematics, Potchefstroomse Universiteit vir Christelike Hoe¨r Onderrig, P. O. Box 1174, Vanderbijlpark 1900, South Africa; L. Pluym, Shaanxi Institute for Finance and Economics (Shaanxi Caijing Xueyuan), Xi’an Cuihua Lu 105, ZIP 710061, P.R. China. Permission to make digital / hard copy of part or all of this work for personal or classroom use is granted without fee provided that the copies are not made or distributed for profit or commercial advantage, the copyright notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and / or a fee. © 1997 ACM 0098-3500/97/0300 –0001 $03.50 ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997, Pages 1–15.
2
•
Ronald Cools et al.
1993] of developments since then makes it plain that there are only four two-dimensional regions for which there exist a significant variety of cubature formulas: the square C 2 , the circle S 2 , the unit triangle T 2 , and the plane E 2 . With the aid of affine transformations that do not affect the degree of a cubature formula, one can accommodate any parallelogram, ellipse, or triangle. It is therefore not surprising that programs for adaptive cubature have been geared to the rectangle and triangle [Bernsten and Espelid 1992; Genz and Malik 1980; Haegemans 1977; Laurie 1982; Van Dooren and De Ridder 1976]. These programs work by dissecting regions into smaller regions that are affinely similar to the original region: a rectangle can be cut into two or four rectangles, a triangle into two or four triangles (analogous dissections for the circle and plane are not possible). In principle one can therefore integrate over a very general class of regions: all that you1 have to do is to divide the region into pieces that can be transformed to squares or triangles, make the required transformation, and call the adaptive integrator for each piece. This process still imposes a great deal of work on you. After transformation, each transformed region has a different integrand, and you must therefore code a different function routine for each piece. You are also required to do the transformations manually (by which we mean, through the use of some mathematical ability extraneous to the adaptive integrator). The ideal aspired to by an automatic integrator, “to relieve the person who has to compute an integral of any need to think” [Davis and Rabinowitz 1984], is a long way off. The aim of the present work is to present a program that goes as far as we can toward that ideal. You specify the geometry of the integration region in a direct way— e.g., the point A at (1, 0) is defined by saying Point A(1, 0), and the triangle ABC is defined by saying TRIANGLE ABC(A, B, C). Region collections are formed by adding regions, literally: REGION_COLLECTION R 5 R1 1 R2. Internally, each region is associated with its own integrand, but you can specify a single integrand over the whole region: for example the function call Integrate(f, R) would return an approximation to the integral of the function f over the region collection R. The program itself keeps track of the required transformations. The only other published cubature program of which we are aware that has even a modest ability to automatize transformations is DITAMO [Robinson and de Doncker 1981]. In order to attain this simple appearance of the package to the end-user, and at the same time to have available the formidable object-oriented abilities required for the wide range of data structures arising from the many shapes and transformations, we decided to write the program in C11. (A preliminary version formed the bulk of the master’s thesis of one of the authors [Pluym 1993].) It is called Cubpack11 to acknowledge our 1
We refer to the user of an automatic package as “you” for the sake of conciseness and apologize to any reader who finds this convention overfamiliar.
ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
3
debt to the Fortran package Cubpack [Cools and Haegemans 1992] that is still in gestation. It would be wrong to think of Cubpack11 as static in the sense that its predecessor Quadpack is static, namely that the algorithms in it have been laid down. On the contrary, Cubpack11 has an open-ended design thanks to the inheritance and polymorphism of C11. New shapes can be added by an implementor without any need to change a single line of the procedures that already exist. The reader will notice that we often use the phrase “at present” in this article: the intention is to emphasize that the choices that we have made as to which cubature formulas, subdivision strategies, etc. to adopt are not inflexible. The organization of the article is (1) we first describe the basic design philosophy of the program, (2) thereafter give details of some of the techniques employed, and (3) finally give a few examples. Readers who see themselves as potential “users” who do not need to know how the package works are advised to skip straight to Section 7, which is self-contained. 2. BASIC DESIGN PHILOSOPHY OF CUBPACK11 The central data structure in Cubpack11 is a region collection, which consists of a number of regions. For example, if you create a triangular region by saying TRIANGLE ABC(A, B, C), then the package will construct an object ABC that contains a data-store to be used to store all regions created when one integrates over the triangle. Initially that data-store has only one item, the triangle itself. Apart from this data-store, the object ABC also contains a number of attributes (the total approximate integral and error estimate, requested absolute and relative tolerances, and a count of the number of function evaluations) all with respect to the triangle mentioned. Each region also has a number of attributes, including a description of its geometry, an integrand, an approximate integral with associated error estimate, and its “state” (of which more later). You may specify any of a large number of shapes. We call a region a primitive region if a cubature formula has been implemented for it. Nonprimitive regions are internally transformed to a primitive region. The integrand is transformed at the same time. At present, a primitive region is one of the four mentioned in the opening paragraph of this article: rectangle, triangle, circle, plane. Some of the states of a region are virgin, which means that it has not yet been processed, active, which means that an approximate integral and error estimate have been computed for it, and hopeless, which means that it has been decided that the current error estimate for that region cannot be reduced (usually because roundoff error has become obtrusive). So, a region that is not virgin is active and vice versa, and a region that is hopeless must also be active. A key operation on a region is “processing.” Each region is processed at least once: it is not added to the collection before it has been processed. In the case of a virgin region, processing means either the application of a ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
4
•
Ronald Cools et al. Table I.
Elementary Transformations
transformation to obtain another virgin region of different shape (we call this strategy “passing the buck”) or the application of a basic cubature formula with error estimate (see Section 5). In the case of active regions, processing at present means subdivision, although in principle it might mean the application of a more accurate cubature formula. The region or regions obtained by processing an active region are called its “descendants.” A typical stage of the integration process proceeds as follows: (1) Check the criteria for success, which occurs when either the absolute or relative requested error tolerance has been attained, i.e.,
uAbsoluteErroru # AbsoluteErrorRequest or
uAbsoluteErroru # uIntegralu 3 RelativeErrorRequest. If either is attained, the integrator stops, reporting “success.” You can force that one or the other of these criteria must be satisfied by specifying the requested error for the other as zero. (2) Check the criteria for failure, which occurs when a specified number of function evaluations have been attained or when it is certain that success cannot be achieved (usually because too many of the subregions are hopeless). If either of these conditions apply, the integrator stops, reporting “failure.” (3) Select the region with largest error estimate for processing. The selected region is removed from the collection, and its descendants (one or more) are added to it. In the process, the total approximate integral and error estimate are updated. 3. TRANSFORMATION OF THE INTEGRAND Each region has its own integrand. Because transformations form such an important part of the package, the integrand is thought of as a stack of transformations, at the bottom of which the function is evaluated. Apart from the standard affine transformations (scaling and translation), we use the transformations in Table I with the aid of which each admissible region can be transformed to a primitive region, as in Table II. ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11 Table II.
•
5
Transformations of Regions
A region may need to be transformed several times before it becomes a primitive region. In general the kth region will be expressed as
V k 5 T 1T 2 . . . T mQ where Q is a primitive region; T i is a transformation; and J i is the Jacobian of T i . The actual integrand is defined only for points in V k . In order to evaluate the integrand at a point x supplied by the primitive integrator for Q, we proceed as follows: w 5 1; for i 5 m : 21 ; 1 w 4 wJ i ( x) x 4 T ix end return(uwuf( x)) Note that we multiply by the absolute value of the Jacobian, in order to avoid anomalies that arise otherwise (e.g., the sign of the integral of a positive function would depend on the way the region is specified). 4. SIMPLE REGIONS A simple region is roughly defined as a region that can be specified using a small number of parameters, and more precisely as a region for which a C11 class has been defined in the program. Each simple region has at least one constructor, which is the routine called by your main program to define it (like TRIANGLE ABC(A, B, C)) and a processor. We have predefined 15 types of simple regions of which specific instances are determined by at most five parameters. Hence we believe enough simple regions are predefined so that it likely a user will be able to dissect his or her actual region into pieces that are supported by the program. As far as possible, the regions are defined in terms of points. In Figure 1 we show the various bounded simple regions defined at present (the region is the interior of the solid line). In Figure 2 we show the various unbounded simple regions defined at present (the region is that part of the plane marked with X and bounded by the solid lines; lines with an arrow have to be extended to infinity). For more details about the specification of these ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
6
•
Ronald Cools et al.
Fig. 1.
Finite regions available in Cubpack11.
regions, we refer to the Cubpack11 User’s Manual [Cools et al. 1994]. At this point, we only want to mention that the regions are specified by the user by giving the points or distances indicated in the figures. The transformations applied to nonprimitive regions appear in Table II. 5. PRIMITIVE REGIONS In this section we describe the cubature formulas and subdivision strategies for the primitive regions. To “treat” a region is here taken to mean to integrate a given function over the region. 5.1 The Triangle T 2 For the triangle, we have simply translated into C the Fortran 77 routine DRLTRI from the program DCUTRI of Bernsten and Espelid, together with all the heuristics given there. A virgin triangle is treated using a fully symmetric (i.e., invariant under all permutations of the vertices) cubature formula T2rule13 of degree 13 with 37 points for the unit triangle, taken from the routine DRLTRI in the package DCUTRI [Bernsten and Espelid 1992]. The unit triangle is transACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
7
Fig. 2. Infinite regions available in Cubpack11. The region is that part of the plane marked with X and bounded by the solid lines; lines with an arrow have to be extended to infinity.
formed to the given triangle, while the cubature formula maintains its degree. An active triangle is, as in DCUTRI, dissected into four congruent triangles by lines running parallel to the sides as in Figure 3. Hence for triangles Cubpack11 behaves like DCUTRI.
5.2 The Parallelogram C 2 A virgin parallelogram is treated using a fully symmetric (i.e., invariant under the symmetry group D 4 of the square) cubature formula C2rule13 of degree 13 with 37 points [Rabinowitz and Richter 1969; Stroud 1971] for the unit square. The unit square is transformed to the given parallelogram by an affine transformation, while the cubature formula maintains its degree. An active parallelogram is, as in Cools [1994], dissected into two or four parallelograms by lines running parallel to the sides as in Figure 3. Hence for parallelograms, Cubpack11 behaves like DCUGIN [Cools 1994].
5.3 The Circle S 2 A virgin circle is treated using a fully symmetric (i.e., D 4 -invariant) cubature formula S2rule13 of degree 13 with 36 points [Cools and Haegemans 1987] for the unit circle. The unit circle is transformed by an affine transformation to the given circle, while the cubature formula maintains its degree. It is important for us to use a cubature formula that does not use the origin, because the inversion of a circle should not produce a point at infinity. ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
8
•
Ronald Cools et al.
Fig. 3.
Used subdivisions of a triangle, a parallelogram, and a circle.
An active circle is dissected into a circle and four polar rectangles, as in Figure 3, such that all five subregions are of equal area. If this kind of subdivision has occurred too many times, then the active circle is divided into four polar rectangles such that all four subregions are of equal area.
5.4 The Plane E 2 A virgin plane is treated using a fully symmetric (i.e., D 4 -invariant) cubature formula E2rule13 of degree 13 with 36 points [Cools and Haege2 2 mans 1987] for the plane with weight function w( x, y) 5 e 2x 2y ; the published weights have been modified so that the resulting formula is directly applicable to integrals of the form
EE `
`
2`
2`
f ~ x, y ! dx dy.
Unlike the three previously considered regions, the approximation to the integral obtained from this cubature formula is not invariant when f is subjected to an affine transformation, because we are in effect integrating 2 2 e x 1y f( x, y) by a formula designed for polynomials. An active plane is dissected into a circle and its exterior. The latter is itself immediately transformed to a circle by inversion. Our approach is to dissect the plane so that the circle and its exterior give approximately equal contributions to the integrand. The information required for this purpose is obtained by doing a few extra calculations during the evaluation of the cubature formula, which we need to describe in greater detail. The cubature formula E2rule13 consists of orbits of radius r k , k 5 1, 2, . . . , 7, with either four or eight points per orbit; the function value at each point in orbit k is multiplied by the same weight w k . (We are now referring to the original weights, not the modified weights of our program!) It is possible to interpret the cubature formula as a Riemann sum by ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
9
drawing circles of increasing radius s k , k 5 0, . . . , 7 (where s 0 5 0 and s7 5 `), so that
EE
n kw k 5
2
2
e 2x 2y dx dy,
k 5 1, 2, . . . , 7
Rk
where R k is the annulus between radii s k21 and s k , and n k is the number of points inside that annulus. We then add up contributions from the orbits
O f~ x nk
2
rk
Ik 5 e wk
k,i
, y k,i! ,
k 5 1, 2, . . . , 7
i51
in sequence of increasing k until it is found at k 5 m that, after the addition of I m , the cumulative integral is more than half of the total. The radius s at which the plane is subdivided should therefore be in the range s m21 # s # s m . 2 2 We model the integrand inside R m as a constant multiple of e 2x 2y . Let f be the fraction of I m that would bring us to just half the total: then we compute the radius s so that
f n mw m 5
EE
2
2
e 2x 2y dx dy,
R
where R is the annulus between radii s m21 and s. This radius s is then stored to be available for use if the plane is later selected for improvement. 6. ERROR ESTIMATION The only published rule used here that comes complete with an error estimation strategy is that for the triangle. The error estimation strategy is nowadays known as a “Norwegian error estimator”; e.g., see Bernsten and Espelid [1991]. For the other regions, we have adopted the same general philosophy, which we briefly describe below. For a full motivation, see Bernsten and Espelid [1992] for the triangle and Cools [1994] for the rectangle. For each m-point cubature formula Q of degree q, there is a linear space of m-point null rules using all the points of Q but with different weights, such that the symmetry of Q is retained. A null rule N d of degree d maps to zero all polynomials of degree not more than d, but not all polynomials of degree d 1 1. The null rules are orthogonalized by regarding their coefficients as vectors in R m , and normalized to have the same length in R m as Q. When two null rules N d, 1 and N d, 2 of the same degree exist, the number
Nd f 5
Î~ N
d,1
f ! 2 1 ~ Nd,2 f ! 2
ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
10
•
Ronald Cools et al.
is computed: in this way a single number Nd f is obtained for each available degree d. We call this a combined null rule. We will use the tuple (d, d) to refer to such a combined null rule and (d) to refer to a single null rule. The highest value s among the possible degrees d attained by a null rule is usually substantially less than the degree q of the cubature formula, which in all the cases considered here is 13. For the cubature formula of degree 13 for the triangle used in DRLTRI, nine independent fully symmetric null rules exist, of degrees 7, 7, 6, 5, 5, 4, 3, 2, and 1. DRLTRI however only makes use of odd-degree fully symmetric null rules, and more particularly a set of null rules of degrees (7,7), (5,5), (3,3), and (1,1) is used. For the cubature formula of degree 13 for the square that we use, seven independent fully symmetric null rules exist, of degrees (7,7), (5,5), (3,3), and (1). For the circle and plane, only six independent fully symmetric null rules exist, of degrees (7), (5,5), (3,3), and (1). In the case of the plane, the null rules map to zero functions of the form exp(2x 2 2 y 2 ) f( x), with f a polynomial of the degree in question. For each cubature formula used in Cubpack11, the program evaluates combined null rules to obtain N1 f, N3 f, N5 f, and N7 f. Following Bernsten and Espelid [1991], who give a heuristic motivation, it is postulated that when the integrand is smooth enough, Nd f ; cr d for certain unknown constants r and c (see also Laurie [1994]) so that Nd12 f/Nd f ' r 2 for d 5 1, 3, 5. This relation, termed strong asymptotic behavior, leads to the error estimate uQf 2 If u ' kr q2s Ns f, where k . 1 is a safety factor. To determine r, we compute the quantities
r1 5
S D N7 f
N5 f
1/ 2
, r2 5
S D N5 f
N3 f
1/ 2
, r3 5
S D N3 f
1/ 2
N1 f
and take r to be the maximum of the r i . The test for strong asymptotic behavior is that r is less than a certain critical value r crit. If r . 1, there is assumed to be no asymptotic behavior at all, and the error estimate is KNs f, where K is another safety factor. In order to have a continuous transition between nonasymptotic and strong asymptotic behavior, the error estimate Kr 2 Ns f is used when r crit # r # 1 (weak asymptotic behavior) and when the safety factors are related by k 5 s2q12 Kr crit . The two free parameters r crit and K in the error estimate have been tuned for optimal performance (according to the trade-off we make between reliability and efficiency) by subjecting the package to a battery of test cases. This has been done separately for each cubature rule. 7. INTEGRATORS The Cubpack11 package has been run successfully on several C11 compilers. The test results below were obtained by Gnu C11 2.7.2 with libg11 2.7.2. One can download the software from ftp.cs.kuleuven.ac.be where it is located in the directory pub/NumAnal-ApplMath/Cubpack, ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
11
where a list of compilers that have successfully compiled the package can also be found. An alternative path is offered via http://www.cs.kuleuven. ac.be/ ˜ronald/ on the World Wide Web. We start with an extremely simple case: to integrate f( x, y) 5 x 2 over a triangle with vertices at (0,0), (1,1), and (2,0). The complete main program to be coded is as follows: #include ^cubpack.h& #include ^iostream.h& real f(const Point& p) { real x5p.X( ); return x*x; } int main( ) { Point p1(0,0), p2(1,1), p3(2,0); TRIANGLE T(p1,p2,p3); cout ,, “The integral is ” ,, Integrate(f,T) ,, endl; return 0; }
The two #include statements inform the compiler where to find the description of the Cubpack11 and input-output routines. The function f uses the data types real and Point defined in the package. In the main procedure, the vertices are defined as points; the triangle is defined in terms of the vertices; and the integrator is called. The actual output from the program is The integral is 1.16667 Because the integrand is only a second-degree polynomial, Cubpack11 returns the expected result, 7/6, with 37 integrand evaluations. This simple version of the integrator uses default values for the accuracy to which the integral should be evaluated and the amount of work permitted. If you want explicit control over the integration process, you can supply these values: the full header with its default arguments is real Integrate( Function f, COMPOUND_REGION& CR, real AbsoluteErrorRequest 5 0.0, real RelativeErrorRequest 5 DEFAULT_REL_ERR_REQ, unsigned long MaxEval 5 100000);
The constant DEFAULT_REL_ERR_REQ is defined in the package. As usual with C11 you may omit any number of trailing arguments for which defaults are given. ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
12
•
Ronald Cools et al.
The integrator tries to compute an approximation to the integral of f on CR which satisfies
uAbsoluteErroru # AbsoluteErrorRequest or
uAbsoluteErroru # uIntegralu 3 RelativeErrorRequest, whichever of these it reaches first. The result is returned via Integral and AbsoluteError. However it will at most do MaxEval function evaluations. The following example shows some of the more advanced features: the requested absolute and relative tolerances and the maximum number of function evaluations are specified; the actual number of function evaluations is shown. The function f ( x, y) 5 exp(21/ 2( x 2 1 y 2 )) is to be integrated over a plane sector of angle u, where tanu 5 2. // Example 33 from DITAMO // Exact value 5 arctan(2) // Note that the “exact” value in the original paper is wrong. #include ^cubpack.h& #include ^iostream.h& real f(const Point& p) { real x5p.X( ) , y5p.Y( ); return exp(0.5p(2xpx 2ypy)); } int main ( ) { Point origin(0,0); real innerradius50, alfa50, beta5atan(2.0); PLANE_SECTOR wedge(origin,innerradius,alfa,beta); EvaluationCounter count; count.Start( ); cout ,,“The integral is ” ,, Integrate(f,wedge,0.0,1.0e22,1000); count.Stop( ); cout ,,“ with estimated absolute error ” ,, wedge.AbsoluteError( ) ,, “.” ,, endl ,,“The real error is ”,, wedge.Integral( ) 2 atan(2.0),,“.”,,endl ,, count.Read( ) ,, “ function evaluations were needed.” ,, endl; return 0; }
A plot of points where the function was evaluated is shown in Figure 4. The actual output from the program is ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
13
Fig. 4. Points where exp(21/2(x2 1 y2)) is evaluated when integrated over a plane sector (some large points were omitted).
The integral is 1.10971 with estimated absolute error 8.99857e203. The real error is 2.55791e203. 588 function evaluations were needed.
For this example DITAMO produces the following: The integral is 1.10716 with estimated absolute error 9.11740e204. The real error is 1.054e205. 961 function evaluations were needed.
Our final example shows how to specify a region built of more than one subregion. The house-shaped region shown in Figure 5 consists of a rectangle and a triangle. We only show the contents of the main procedure. A more detailed description of this example is presented in the user manual [Cools et al. 1994]. Observe that this example also illustrates another way to use points. Obviously, both notations may be mixed. TRIANGLE Roof( Point(0,1), Point(2,1), Point(1,2)); RECTANGLE Walls( Point(0,0), Point(0,1), Point(2,0)); REGION_COLLECTION House 5 Roof 1 Walls; cout ,, “integral over the house-shaped region ” ,, Integrate(f,House);
It is not necessary to use REGION_COLLECTION explicitly. It is also allowed to write Integrate(f,Roof1Walls). ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
14
•
Ronald Cools et al.
Fig. 5.
A house.
After calling Integrate you can access the integral and error on each part of a collection, i.e., you know Roof.Integral( ) as well as Walls.Integral( ), etc. You are allowed to integrate different functions over different parts of a REGION_COLLECTION, which may for instance be useful when your integrand is discontinuous. In that case, you use a version of Integrate that omits the first argument (i.e., the integrand) and instead associate an integrand with each region, like this: Roof.LocalIntegrand(f1); Walls.LocalIntegrand(f2); cout ,, “the result is ” ,, Integrate(Roof1Walls);
The full header for this integrator is real Integrate( COMPOUND_REGION& CR, real AbsoluteErrorRequest 5 0.0, real RelativeErrorRequest 5 DEFAULT_REL_ERR_REQ, unsigned long MaxEval 5 100000);
If the automatic integrator cannot satisfy one of the error requests, the flag Success will be set to False; otherwise it will be set to True (see Section 2). The flag Success cannot be seen when you use the simple integrator explained above, whose only output is a function value. Versions of Integrate are provided that have this as an output parameter, in addition to for example the integral and error estimates. For a full description of the different versions of Integrate we provided, we refer to the user manual [Cools et al. 1994]. This document gives also some additional examples. The package contains a directory with more example programs that illustrate different aspects of the package.
ACKNOWLEDGMENTS
The first author acknowledges financial support of the Belgian National Science Foundation and the Department of Mathematics of the Potchefstroomse Universiteit vir Christelike Hoe¨r Onderrig, South Africa. The second author thanks Prof. Ann Haegemans for generous financial sponsorship while on sabbatical at the Katholieke Universiteit Leuven. ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.
Algorithm 764: Cubpack11
•
15
REFERENCES BERNTSEN, J. AND ESPELID, T. O. 1991. Error estimation in automatic quadrature routines. ACM. Trans. Math. Softw. 17, 233–252. BERNSTEN, J. AND ESPELID, T. O. 1992. Algorithm 706: DCUTRI: An algorithm for adaptive cubature over a collection of triangles. ACM. Trans. Math. Softw. 18, 329 –342. COOLS, R. 1994. The subdivision strategy and reliability in adaptive integration revisited. Rep. TW 213, Dept. of Computer Science, Katholieke Univ. Leuven, Leuven, Belgium. COOLS, R. AND HAEGEMANS, A. 1987. Construction of fully symmetric cubature formulae of degree 4k 2 3 for fully symmetric planar regions. J. Comput. Appl. Math. 17, 173–180. COOLS, R. AND HAEGEMANS, A. 1992. CUBPACK: Progress report. In Numerical Integration—Recent Developments, Software and Applications, T. O. Espelid and A. Genz, Eds. NATO ASI Series C: Mathematics and Physical Sciences, vol. 357. Kluwer Academic, Dordrecht, 305–315. COOLS, R. AND RABINOWITZ, P. 1993. Monomial cubature rules since ‘Stroud’: A compilation. J. Comput. Appl. Math. 48, 309 –326. COOLS, R., LAURIE, D., AND PLUYM, L. 1994. A user manual for Cubpack11. Rep. TW 221, Dept. of Computer Science, Katholieke Univ. Leuven, Leuven, Belgium. DAVIS, P. J. AND RABINOWITZ, P. 1984. Methods of Numerical Integration. Academic Press, London. GENZ, A. C. AND MALIK, A. A. 1980. An adaptive algorithm for numerical integration over an N-dimensional rectangular region. J. Comput. Appl. Math. 6, 295–302. HAEGEMANS, A. 1977. Algorithm 34: An algorithm for the automatic integration over a triangle. Computing 19, 179 –187. LAURIE, D. P. 1982. CUBTRI—Automatic cubature over a triangle. ACM Trans. Math. Softw. 8, 210 –218. LAURIE, D. P. 1994. Null rules and orthogonal expansions. In Approximation and Computation: A Festschrift in Honor of Walter Gautschi, R. V. M. Zahar, Ed. International Series of Numerical Mathematics, vol. 119. Birkha¨user, 359 –370. PLUYM, L. 1993. Software voor automatische integratie van functies in meerdere veranderlijken. Master thesis, Dept. of Computer Science, Katholieke Univ. Leuven, Leuven, Belgium. RABINOWITZ, P. AND RICHTER, N. 1969. Perfectly symmetric two-dimensional integration formulas with minimal number of points. Math. Comput. 23, 765–799. ROBINSON, I. AND DE DONCKER, E. 1981. Algorithm 45: Automatic computation of improper integrals over a bounded or unbounded planar region. Computing 27, 253–284. STROUD, A. H. 1971. Approximate Calculation of Multiple Integrals. Prentice-Hall, Englewood Cliffs, N.J. VAN DOOREN, P. AND DE RIDDER, L. 1976. An adaptive algorithm for numerical integration over an n-dimensional cube. J. Comput. Appl. Math. 2, 207–217. Received December 1994; revised April 1996; accepted July 1996
ACM Transactions on Mathematical Software, Vol. 23, No. 1, March 1997.