forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaguerre_test_int.html
625 lines (590 loc) · 17.3 KB
/
laguerre_test_int.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
<html>
<head>
<title>
LAGUERRE_TEST_INT - Quadrature Tests for Semi-Infinite Intervals
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
LAGUERRE_TEST_INT <br> Quadrature Tests for Semi-Infinite Intervals
</h1>
<hr>
<p>
<b>LAGUERRE_TEST_INT</b>
is a C++ library which
defines integration problems over
semi-infinite intervals of the form [ALPHA,+oo).
</p>
<p>
The test integrands would normally be used to testing one
dimensional quadrature software. It is possible to invoke a
particular function by index, or to try out all available functions,
as demonstrated in the sample calling program.
</p>
<p>
The test integrands include:
<ol>
<li>
1 / ( x * log(x)^2 );
</li>
<li>
1 / ( x * log(x)^(3/2) );
</li>
<li>
1 / ( x^1.01 );
</li>
<li>
Sine integral;
</li>
<li>
Fresnel integral;
</li>
<li>
Complementary error function;
</li>
<li>
Bessel function;
</li>
<li>
Debye function;
</li>
<li>
Gamma(Z=4) function;
</li>
<li>
1/(1+x*x);
</li>
<li>
1 / ( (1+x) * sqrt(x) );
</li>
<li>
exp ( - x ) * cos ( x );
</li>
<li>
sin(x) / x;
</li>
<li>
sin ( exp(-x) + exp(-4x) );
</li>
<li>
log(x) / ( 1+100*x*x);
</li>
<li>
cos(0.5*pi*x) / sqrt(x);
</li>
<li>
exp ( - x / 2^beta ) * cos ( x ) / sqrt ( x )
</li>
<li>
x^2 * exp ( - x / 2^beta )
</li>
<li>
x^(beta-1) / ( 1 + 10 x )^2
</li>
<li>
1 / ( 2^beta * ( ( x - 1 )^2 + (1/4)^beta ) * ( x - 2 ) )
</li>
</ol>
</p>
<p>
The library includes not just the integrand, but also the value of
ALPHA which defines the interval of integration, and the exact value
of the integral (or, typically, an estimate of this value).
Thus, for each integrand function, three subroutines are supplied. For
instance, for function #1, we have the routines:
<ul>
<li>
<b>P01_FUN</b> evaluates the integrand for problem 1.
</li>
<li>
<b>P01_ALPHA</b> returns the value of ALPHA for problem 1.
</li>
<li>
<b>P01_EXACT</b> returns the estimated integral for problem 1.
</li>
<li>
<b>P01_TITLE</b> returns a title for problem 1.
</li>
</ul>
So once you have the calling sequences for these routines, you
can easily evaluate the function, or integrate it on the
appropriate interval, or compare your estimate of the integral
to the exact value.
</p>
<p>
Moreover, since the same interface is used for each function,
if you wish to work with problem 5 instead, you simply change
the "01" to "05" in your routine calls.
</p>
<p>
If you wish to call <i>all</i> of the functions, then you
simply use the generic interface, which again has three
subroutines, but which requires you to specify the problem
number as an extra input argument:
<ul>
<li>
<b>P00_FUN</b> evaluates the integrand for any problem.
</li>
<li>
<b>P00_ALPHA</b> returns the value of ALPHA for any problem.
</li>
<li>
<b>P00_EXACT</b> returns the exact integral for any problem.
</li>
<li>
<b>P00_TITLE</b> returns a title for any problem.
</li>
</ul>
</p>
<p>
Finally, some demonstration routines are built in for
simple quadrature methods. These routines include
<ul>
<li>
<b>P00_EXP_TRANSFORM</b> applies an exponential change of
variables, and then uses a Gauss-Legendre quadrature formula
to estimate the integral for any problem.
</li>
<li>
<b>P00_GAUSS_LAGUERRE</b> uses a Gauss-Laguerre quadrature formula
to estimate the integral for any problem.
</li>
<li>
<b>P00_RAT_TRANSFORM</b> applies a rational change of
variables, and then uses a Gauss-Legendre quadrature formula
to estimate the integral for any problem.
</li>
</ul>
and can be used with any of the sample integrands.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>LAGUERRE_TEST_INT</b> is available in
<a href = "../../c_src/laguerre_test_int/laguerre_test_int.html">a C version</a> and
<a href = "../../cpp_src/laguerre_test_int/laguerre_test_int.html">a C++ version</a> and
<a href = "../../f77_src/laguerre_test_int/laguerre_test_int.html">a FORTRAN77 version</a> and
<a href = "../../f_src/laguerre_test_int/laguerre_test_int.html">a FORTRAN90 version</a> and
<a href = "../../m_src/laguerre_test_int/laguerre_test_int.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/quadpack/quadpack.html">
QUADPACK</a>,
a FORTRAN90 library which
estimates integrals of functions in one dimension.
</p>
<p>
<a href = "../../cpp_src/quadrule/quadrule.html">
QUADRULE</a>,
a C++ library which
defines various quadrature rules.
</p>
<p>
<a href = "../../cpp_src/test_int/test_int.html">
TEST_INT</a>,
a C++ library which
defines test integrands for 1D quadrature rules.
</p>
<p>
<a href = "../../cpp_src/test_int_2d/test_int_2d.html">
TEST_INT_2D</a>,
a C++ library which
defines test integrands for 2D quadrature rules.
</p>
<p>
<a href = "../../cpp_src/test_int_hermite/test_int_hermite.html">
TEST_INT_HERMITE</a>,
a C++ library which
defines some test integration problems over infinite intervals.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Philip Davis, Philip Rabinowitz,<br>
Methods of Numerical Integration,<br>
Second Edition,<br>
Dover, 2007,<br>
ISBN: 0486453391,<br>
LC: QA299.3.D28.
</li>
<li>
Robert Piessens, Elise deDoncker-Kapenga,
Christian Ueberhuber, David Kahaner,<br>
QUADPACK: A Subroutine Package for Automatic Integration,<br>
Springer, 1983,<br>
ISBN: 3540125531,<br>
LC: QA299.3.Q36.
</li>
<li>
Arthur Stroud, Don Secrest,<br>
Gaussian Quadrature Formulas,<br>
Prentice Hall, 1966,<br>
LC: QA299.4G3S7.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "laguerre_test_int.cpp">laguerre_test_int.cpp</a>,
the source code;
</li>
<li>
<a href = "laguerre_test_int.hpp">laguerre_test_int.hpp</a>,
the include file;
</li>
<li>
<a href = "laguerre_test_int.sh">laguerre_test_int.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "laguerre_test_int_prb.cpp">laguerre_test_int_prb.cpp</a>,
the calling program;
</li>
<li>
<a href = "laguerre_test_int_prb.sh">laguerre_test_int_prb.sh</a>,
commands to compile, link and run the calling program;
</li>
<li>
<a href = "laguerre_test_int_prb_output.txt">laguerre_test_int_prb_output.txt</a>,
the output file.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>LAGUERRE_COMPUTE</b> computes a Gauss-Laguerre quadrature rule.
</li>
<li>
<b>LAGUERRE_RECUR</b> finds the value and derivative of a Laguerre polynomial.
</li>
<li>
<b>LAGUERRE_ROOT</b> improves an approximate root of a Laguerre polynomial.
</li>
<li>
<b>LEGENDRE_COMPUTE</b> computes a Gauss-Legendre quadrature rule.
</li>
<li>
<b>P00_ALPHA</b> returns the value of ALPHA for any problem.
</li>
<li>
<b>P00_EXACT</b> returns the exact integral for any problem.
</li>
<li>
<b>P00_EXP_TRANSFORM</b> applies an exponential transform and Gauss-Legendre rule.
</li>
<li>
<b>P00_FUN</b> evaluates the integrand for any problem.
</li>
<li>
<b>P00_GAUSS_LAGUERRE</b> applies a Gauss-Laguerre rule.
</li>
<li>
<b>P00_PROBLEM_NUM</b> returns the number of test integration problems.
</li>
<li>
<b>P00_RAT_TRANSFORM</b> applies a rational transform and Gauss-Legendre rule.
</li>
<li>
<b>P00_TITLE</b> returns the title for any problem.
</li>
<li>
<b>P01_ALPHA</b> returns ALPHA for problem 1.
</li>
<li>
<b>P01_EXACT</b> returns the exact integral for problem 1.
</li>
<li>
<b>P01_FUN</b> evaluates the integrand for problem 1.
</li>
<li>
<b>P01_TITLE</b> returns the title for problem 1.
</li>
<li>
<b>P02_ALPHA</b> returns ALPHA for problem 2.
</li>
<li>
<b>P02_EXACT</b> returns the exact integral for problem 2.
</li>
<li>
<b>P02_FUN</b> evaluates the integrand for problem 2.
</li>
<li>
<b>P02_TITLE</b> returns the title for problem 2.
</li>
<li>
<b>P03_ALPHA</b> returns ALPHA for problem 3.
</li>
<li>
<b>P03_EXACT</b> returns the exact integral for problem 3.
</li>
<li>
<b>P03_FUN</b> evaluates the integrand for problem 3.
</li>
<li>
<b>P03_TITLE</b> returns the title for problem 3.
</li>
<li>
<b>P04_ALPHA</b> returns ALPHA for problem 4.
</li>
<li>
<b>P04_EXACT</b> returns the estimated integral for problem 4.
</li>
<li>
<b>P04_FUN</b> evaluates the integrand for problem 4.
</li>
<li>
<b>P04_TITLE</b> returns the title for problem 4.
</li>
<li>
<b>P05_ALPHA</b> returns ALPHA for problem 5.
</li>
<li>
<b>P05_EXACT</b> returns the estimated integral for problem 5.
</li>
<li>
<b>P05_FUN</b> evaluates the integrand for problem 5.
</li>
<li>
<b>P05_TITLE</b> returns the title for problem 5.
</li>
<li>
<b>P06_ALPHA</b> returns ALPHA for problem 6.
</li>
<li>
<b>P06_EXACT</b> returns the exact integral for problem 6.
</li>
<li>
<b>P06_FUN</b> evaluates the integrand for problem 6.
</li>
<li>
<b>P06_TITLE</b> returns the title for problem 6.
</li>
<li>
<b>P07_ALPHA</b> returns ALPHA for problem 7.
</li>
<li>
<b>P07_EXACT</b> returns the exact integral for problem 7.
</li>
<li>
<b>P07_FUN</b> evaluates the integrand for problem 7.
</li>
<li>
<b>P07_TITLE</b> returns the title for problem 7.
</li>
<li>
<b>P08_ALPHA</b> returns ALPHA for problem 8.
</li>
<li>
<b>P08_EXACT</b> returns the estimated integral for problem 8.
</li>
<li>
<b>P08_FUN</b> evaluates the integrand for problem 8.
</li>
<li>
<b>P08_TITLE</b> returns the title for problem 8.
</li>
<li>
<b>P09_ALPHA</b> returns ALPHA for problem 9.
</li>
<li>
<b>P09_EXACT</b> returns the estimated integral for problem 9.
</li>
<li>
<b>P09_FUN</b> evaluates the integrand for problem 9.
</li>
<li>
<b>P09_TITLE</b> returns the title for problem 9.
</li>
<li>
<b>P10_ALPHA</b> returns ALPHA for problem 10.
</li>
<li>
<b>P10_EXACT</b> returns the estimated integral for problem 10.
</li>
<li>
<b>P10_FUN</b> evaluates the integrand for problem 10.
</li>
<li>
<b>P10_TITLE</b> returns the title for problem 10.
</li>
<li>
<b>P11_ALPHA</b> returns ALPHA for problem 11.
</li>
<li>
<b>P11_EXACT</b> returns the estimated integral for problem 11.
</li>
<li>
<b>P11_FUN</b> evaluates the integrand for problem 11.
</li>
<li>
<b>P11_TITLE</b> returns the title for problem 11.
</li>
<li>
<b>P12_ALPHA</b> returns ALPHA for problem 12.
</li>
<li>
<b>P12_EXACT</b> returns the estimated integral for problem 12.
</li>
<li>
<b>P12_FUN</b> evaluates the integrand for problem 12.
</li>
<li>
<b>P12_TITLE</b> returns the title for problem 12.
</li>
<li>
<b>P13_ALPHA</b> returns ALPHA for problem 13.
</li>
<li>
<b>P13_EXACT</b> returns the estimated integral for problem 13.
</li>
<li>
<b>P13_FUN</b> evaluates the integrand for problem 13.
</li>
<li>
<b>P13_TITLE</b> returns the title for problem 13.
</li>
<li>
<b>P14_ALPHA</b> returns ALPHA for problem 14.
</li>
<li>
<b>P14_EXACT</b> returns the estimated integral for problem 14.
</li>
<li>
<b>P14_FUN</b> evaluates the integrand for problem 14.
</li>
<li>
<b>P14_TITLE</b> returns the title for problem 14.
</li>
<li>
<b>P15_ALPHA</b> returns ALPHA for problem 15.
</li>
<li>
<b>P15_EXACT</b> returns the estimated integral for problem 15.
</li>
<li>
<b>P15_FUN</b> evaluates the integrand for problem 15.
</li>
<li>
<b>P15_TITLE</b> returns the title for problem 15.
</li>
<li>
<b>P16_ALPHA</b> returns ALPHA for problem 16.
</li>
<li>
<b>P16_EXACT</b> returns the estimated integral for problem 16.
</li>
<li>
<b>P16_FUN</b> evaluates the integrand for problem 16.
</li>
<li>
<b>P16_TITLE</b> returns the title for problem 16.
</li>
<li>
<b>P17_ALPHA</b> returns ALPHA for problem 17.
</li>
<li>
<b>P17_EXACT</b> returns the exact integral for problem 17.
</li>
<li>
<b>P17_FUN</b> evaluates the integrand for problem 17.
</li>
<li>
<b>P17_TITLE</b> returns the title for problem 17.
</li>
<li>
<b>P18_ALPHA</b> returns ALPHA for problem 18.
</li>
<li>
<b>P18_EXACT</b> returns the exact integral for problem 18.
</li>
<li>
<b>P18_FUN</b> evaluates the integrand for problem 18.
</li>
<li>
<b>P18_TITLE</b> returns the title for problem 18.
</li>
<li>
<b>P19_ALPHA</b> returns ALPHA for problem 19.
</li>
<li>
<b>P19_EXACT</b> returns the exact integral for problem 19.
</li>
<li>
<b>P19_FUN</b> evaluates the integrand for problem 19.
</li>
<li>
<b>P19_TITLE</b> returns the title for problem 19.
</li>
<li>
<b>P20_ALPHA</b> returns ALPHA for problem 20.
</li>
<li>
<b>P20_EXACT</b> returns the exact integral for problem 20.
</li>
<li>
<b>P20_FUN</b> evaluates the integrand for problem 20.
</li>
<li>
<b>P20_TITLE</b> returns the title for problem 20.
</li>
<li>
<b>R8_ABS</b> returns the absolute value of an R8.
</li>
<li>
<b>R8_EPSILON</b> returns the R8 roundoff unit.
</li>
<li>
<b>R8_GAMMA</b> evaluates Gamma(X) for a real argument.
</li>
<li>
<b>R8_HUGE</b> returns a "huge" R8.
</li>
<li>
<b>R8VEC_DOT</b> computes the dot product of a pair of R8VEC's.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 27 December 2011.
</i>
<!-- John Burkardt -->
</body>
</html>