summaryrefslogtreecommitdiff
path: root/graphics/asymptote/simpson.cc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-07 03:02:55 +0000
committerNorbert Preining <norbert@preining.info>2020-08-07 03:02:55 +0000
commit3710c23789342d9d88783cbe9ad23eb5263a7c33 (patch)
tree1c40b2bfb9f6b652f7877ad0991f5d6b44391154 /graphics/asymptote/simpson.cc
parentd99fea72e367e8d4d2809b43b3b0206b1bb526b8 (diff)
CTAN sync 202008070302
Diffstat (limited to 'graphics/asymptote/simpson.cc')
-rw-r--r--graphics/asymptote/simpson.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/asymptote/simpson.cc b/graphics/asymptote/simpson.cc
index 85c8c08160..96f9702c49 100644
--- a/graphics/asymptote/simpson.cc
+++ b/graphics/asymptote/simpson.cc
@@ -21,12 +21,12 @@ simpson(double& integral, // Approximate value of the integral.
double dxmax) // Maximum limit on the width of a subinterval
// For periodic functions, dxmax should be
// set to the period or smaller to prevent
-// premature convergence of Simpson's rule.
+// premature convergence of Simpson's rule.
{
double diff,area,estl,estr,alpha,da,dx,wt,est,fv[5];
TABLE table[nest],*p,*pstop;
static const double sixth=1.0/6.0;
-
+
bool success=true;
p=table;
pstop=table+nest-1;
@@ -114,21 +114,21 @@ unsimpson(double integral, // Given value for the integral.
double dxmax, // Maximum limit on the width of a subinterval
// For periodic functions, dxmax should be
// set to the period or smaller to prevent
- // premature convergence of Simpson's rule.
+ // premature convergence of Simpson's rule.
double dxmin=0) // Lower limit on sampling width.
{
double diff,estl,estr,alpha,da,dx,wt,est,fv[5];
double sum,parea,pdiff,b2;
TABLE table[nest],*p,*pstop;
static const double sixth=1.0/6.0;
-
+
p=table;
pstop=table+nest-1;
p->psum=0.0;
alpha=a;
parea=0.0;
pdiff=0.0;
-
+
for(;;) {
p->left=true;
da=b-alpha;
@@ -172,7 +172,7 @@ unsimpson(double integral, // Given value for the integral.
// Accept approximate integral sum.
// If it was a right interval, add results to finish at this level.
// If it was a left interval, process right interval.
-
+
pdiff += diff;
for(;;) {
if(p->left == false) { // process right-half interval