This is the indicator type for generating instances of objects that indicate the integration interval is open and, the intervals should be spaced assuming an integrand that behaves like a NegativeExponent Exponential (NEXP), such that the upper limit of integration is allowed to be \(b = +\infty\).
More...
This is the indicator type for generating instances of objects that indicate the integration interval is open and, the intervals should be spaced assuming an integrand that behaves like a NegativeExponent Exponential (NEXP), such that the upper limit of integration is allowed to be \(b = +\infty\).
This is an empty derived type that exists solely for generating unique objects that are distinguishable as input arguments to procedures under the generic interface getQuadRomb.
Possible calling interfaces ⛓
type(nexp_type) :: NEXP
This module contains classes and procedures to perform numerical integrations.
This is the indicator type for generating instances of objects that indicate the integration interval...
 See also
 lbis_type
nexp_type
open_type
pexp_type
pwrl_type
ubis_type
getQuadRomb
Example usage ⛓
15 real(SP) :: quad_SP, quadref_SP, relerr_SP, kappa_SP, invSigma_SP
16 real(DP) :: quad_DP, quadref_DP, relerr_DP, kappa_DP, invSigma_DP
17 real(QP) :: quad_QP, quadref_QP, relerr_QP, kappa_QP, invSigma_QP
19 type(display_type) :: disp
23 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"! Compute the Cumulative Distribution Function (CDF) over the semiinfinite interval of Exponential distribution.")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
31 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
32 call disp%show(
"! Compute the numerical integration with single precision.")
33 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
37 call disp%show(
"invSigma_SP = 3._SP")
39 call disp%show(
"quadref_SP = getExpCDF(x = log(huge(0._SP)), invSigma = invSigma_SP)")
40 quadref_SP
= getExpCDF(x
= log(
huge(
0._SP)), invSigma
= invSigma_SP)
43 call disp%show(
"quad_SP = getQuadRomb(getFunc = getExpPDF_SP, lb = 0._SP, ub = huge(0._SP), tol = epsilon(1._SP) * 100, nref = 4_IK, interval = nexp_type(), relerr = relerr_SP, neval = neval)")
44 quad_SP
= getQuadRomb(getFunc
= getExpPDF_SP, lb
= 0._SP, ub
= huge(
0._SP), tol
= epsilon(
1._SP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_SP, neval
= neval)
45 call disp%show(
"if (relerr_SP < 0._SP) error stop 'Integration failed to converge.'")
46 if (relerr_SP
< 0._SP)
error stop 'Integration failed to converge.'
47 call disp%show(
"relerr_SP ! < 0. if integration fails.")
49 call disp%show(
"neval ! # calls to the integrand.")
56 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
57 call disp%show(
"! Compute the numerical integration with double precision.")
58 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
62 call disp%show(
"invSigma_DP = 3._DP")
64 call disp%show(
"quadref_DP = getExpCDF(x = log(huge(0._DP)), invSigma = invSigma_DP)")
65 quadref_DP
= getExpCDF(x
= log(
huge(
0._DP)), invSigma
= invSigma_DP)
68 call disp%show(
"quad_DP = getQuadRomb(getFunc = getExpPDF_DP, lb = 0._DP, ub = huge(0._DP), tol = epsilon(1._DP) * 100, nref = 4_IK, interval = nexp_type(), relerr = relerr_DP, neval = neval)")
69 quad_DP
= getQuadRomb(getFunc
= getExpPDF_DP, lb
= 0._DP, ub
= huge(
0._DP), tol
= epsilon(
1._DP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_DP, neval
= neval)
70 call disp%show(
"if (relerr_DP < 0.) error stop 'Integration failed to converge.'")
71 if (relerr_DP
< 0.)
error stop 'Integration failed to converge.'
72 call disp%show(
"relerr_DP ! < 0. if integration fails.")
74 call disp%show(
"neval ! # calls to the integrand.")
81 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
82 call disp%show(
"! Compute the numerical integration with double precision.")
83 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 call disp%show(
"invSigma_QP = 3._QP")
89 call disp%show(
"quadref_QP = getExpCDF(x = log(huge(0._QP)), invSigma = invSigma_QP)")
90 quadref_QP
= getExpCDF(x
= log(
huge(
0._QP)), invSigma
= invSigma_QP)
93 call disp%show(
"quad_QP = getQuadRomb(getFunc = getExpPDF_QP, lb = 0._QP, ub = huge(0._QP), tol = epsilon(1._QP) * 100, nref = 4_IK, interval = nexp_type(), relerr = relerr_QP, neval = neval)")
94 quad_QP
= getQuadRomb(getFunc
= getExpPDF_QP, lb
= 0._QP, ub
= huge(
0._QP), tol
= epsilon(
1._QP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_QP, neval
= neval)
95 call disp%show(
"if (relerr_QP < 0.) error stop 'Integration failed to converge.'")
96 if (relerr_QP
< 0.)
error stop 'Integration failed to converge.'
97 call disp%show(
"relerr_QP ! < 0. if integration fails.")
99 call disp%show(
"neval ! # calls to the integrand.")
101 call disp%show(
"quad_QP ! integral")
106 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
107 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
108 call disp%show(
"! Compute the Cumulative Distribution Function (CDF) over the semiinfinite interval of Gamma distribution whose tail decays exponentially.")
109 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
110 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
114 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
115 call disp%show(
"! Compute the numerical integration with single precision.")
116 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
122 call disp%show(
"invSigma_SP = 2._SP")
124 call disp%show(
"quadref_SP = getGammaIncLow(log(huge(0._SP)), kappa = kappa_SP)  getGammaIncLow(0._SP, kappa = kappa_SP)")
128 call disp%show(
"quad_SP = getQuadRomb(getFunc = getGammaPDF_SP, lb = 0._SP, ub = huge(0._SP), tol = epsilon(1._SP) * 100, nref = 4_IK, interval = nexp_type(), relerr = relerr_SP, neval = neval)")
129 quad_SP
= getQuadRomb(getFunc
= getGammaPDF_SP, lb
= 0._SP, ub
= huge(
0._SP), tol
= epsilon(
1._SP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_SP, neval
= neval)
130 call disp%show(
"if (relerr_SP < 0._SP) error stop 'Integration failed to converge.'")
131 if (relerr_SP
< 0._SP)
error stop 'Integration failed to converge.'
132 call disp%show(
"relerr_SP ! < 0. if integration fails.")
134 call disp%show(
"neval ! # calls to the integrand.")
136 call disp%show(
"quad_SP ! integral")
141 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
142 call disp%show(
"! Compute the numerical integration with double precision.")
143 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
149 call disp%show(
"invSigma_DP = 2._DP")
151 call disp%show(
"quadref_DP = getGammaIncLow(log(huge(0._DP)), kappa = kappa_DP)  getGammaIncLow(0._DP, kappa = kappa_DP)")
155 call disp%show(
"quad_DP = getQuadRomb(getFunc = getGammaPDF_DP, lb = 0._DP, ub = huge(0._DP), tol = epsilon(1._DP) * 100, nref = 7_IK, interval = nexp_type(), relerr = relerr_DP, neval = neval)")
156 quad_DP
= getQuadRomb(getFunc
= getGammaPDF_DP, lb
= 0._DP, ub
= huge(
0._DP), tol
= epsilon(
1._DP)
* 100, nref
= 7_IK, interval
= nexp_type(), relerr
= relerr_DP, neval
= neval)
157 call disp%show(
"if (relerr_DP < 0._DP) error stop 'Integration failed to converge.'")
158 if (relerr_DP
< 0._DP)
error stop 'Integration failed to converge.'
159 call disp%show(
"relerr_DP ! < 0. if integration fails.")
161 call disp%show(
"neval ! # calls to the integrand.")
163 call disp%show(
"quad_DP ! integral")
168 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
169 call disp%show(
"! Compute the numerical integration with quadro precision.")
170 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
176 call disp%show(
"invSigma_QP = 2._QP")
178 call disp%show(
"quadref_QP = getGammaIncLow(log(huge(0._QP)), kappa = kappa_QP)  getGammaIncLow(0._QP, kappa = kappa_QP)")
182 call disp%show(
"quad_QP = getQuadRomb(getFunc = getGammaPDF_QP, lb = 0._QP, ub = huge(0._QP), tol = sqrt(epsilon(1._QP)), nref = 10_IK, interval = nexp_type(), relerr = relerr_QP, neval = neval)")
183 quad_QP
= getQuadRomb(getFunc
= getGammaPDF_QP, lb
= 0._QP, ub
= huge(
0._QP), tol
= sqrt(
epsilon(
1._QP)), nref
= 10_IK, interval
= nexp_type(), relerr
= relerr_QP, neval
= neval)
184 call disp%show(
"if (relerr_QP < 0._QP) error stop 'Integration failed to converge.'")
185 if (relerr_QP
< 0._QP)
error stop 'Integration failed to converge.'
186 call disp%show(
"relerr_QP ! < 0. if integration fails.")
188 call disp%show(
"neval ! # calls to the integrand.")
190 call disp%show(
"quad_QP ! integral")
196 function getExpPDF_SP(x)
result(expPDF)
197 real(SP),
intent(in) :: x
202 function getExpPDF_DP(x)
result(expPDF)
203 real(DP),
intent(in) :: x
208 function getExpPDF_QP(x)
result(expPDF)
209 real(QP),
intent(in) :: x
214 function getGammaPDF_SP(x)
result(gammaPDF)
215 real(SP),
intent(in) :: x
217 gammaPDF
= exp(
getGammaLogPDF(x, kappa
= kappa_SP, invSigma
= invSigma_SP))
220 function getGammaPDF_DP(x)
result(gammaPDF)
221 real(DP),
intent(in) :: x
223 gammaPDF
= exp(
getGammaLogPDF(x, kappa
= kappa_DP, invSigma
= invSigma_DP))
226 function getGammaPDF_QP(x)
result(gammaPDF)
227 real(QP),
intent(in) :: x
229 gammaPDF
= exp(
getGammaLogPDF(x, kappa
= kappa_QP, invSigma
= invSigma_QP))
Generate and return the Cumulative Distribution Function (CDF) of the Exponential distribution for an...
Generate and return the natural logarithm of the Probability Density Function (PDF) of the Exponentia...
Generate and return the natural logarithm of the Probability Density Function (PDF) of the Gamma dist...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
Generate and return the regularized Lower Incomplete Gamma function for the specified shape parameter...
Generate and return the integral of the input function getFunc() in the closed range [lb,...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind typeparameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in CFortran Interoper...
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64bit real kind.
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in CFortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highestprecision real kind t...
integer, parameter RKS
The singleprecision real kind in Fortran mode. On most platforms, this is an 32bit real kind.
This module contains procedures and generic interfaces for the Lower and Upper Incomplete Gamma funct...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort fpp standardsemantics O3 Wl,rpath,../../../lib I../../../inc main.F90 ../../../lib/libparamonte* o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standardsemantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran cpp ffreelinelengthnone O3 Wl,rpath,../../../lib I../../../inc main.F90 ../../../lib/libparamonte* o main.exe
Example output ⛓
15quadref_SP
= getExpCDF(x
= log(
huge(
0._SP)), invSigma
= invSigma_SP)
18quad_SP
= getQuadRomb(getFunc
= getExpPDF_SP, lb
= 0._SP, ub
= huge(
0._SP), tol
= epsilon(
1._SP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_SP, neval
= neval)
19if (relerr_SP
< 0._SP)
error stop 'Integration failed to converge.'
34quadref_DP
= getExpCDF(x
= log(
huge(
0._DP)), invSigma
= invSigma_DP)
37quad_DP
= getQuadRomb(getFunc
= getExpPDF_DP, lb
= 0._DP, ub
= huge(
0._DP), tol
= epsilon(
1._DP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_DP, neval
= neval)
38if (relerr_DP
< 0.)
error stop 'Integration failed to converge.'
40+0.15679231417482677E18
53quadref_QP
= getExpCDF(x
= log(
huge(
0._QP)), invSigma
= invSigma_QP)
55+1.00000000000000000000000000000000000
56quad_QP
= getQuadRomb(getFunc
= getExpPDF_QP, lb
= 0._QP, ub
= huge(
0._QP), tol
= epsilon(
1._QP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_QP, neval
= neval)
57if (relerr_QP
< 0.)
error stop 'Integration failed to converge.'
59+0.100451159285899950138381146936573719E35
63+0.999999999999999999999999999999999422
83quad_SP
= getQuadRomb(getFunc
= getGammaPDF_SP, lb
= 0._SP, ub
= huge(
0._SP), tol
= epsilon(
1._SP)
* 100, nref
= 4_IK, interval
= nexp_type(), relerr
= relerr_SP, neval
= neval)
84if (relerr_SP
< 0._SP)
error stop 'Integration failed to converge.'
103quad_DP
= getQuadRomb(getFunc
= getGammaPDF_DP, lb
= 0._DP, ub
= huge(
0._DP), tol
= epsilon(
1._DP)
* 100, nref
= 7_IK, interval
= nexp_type(), relerr
= relerr_DP, neval
= neval)
104if (relerr_DP
< 0._DP)
error stop 'Integration failed to converge.'
106+0.71143903588068092E14
122+1.00000000000000000000000000000000000
123quad_QP
= getQuadRomb(getFunc
= getGammaPDF_QP, lb
= 0._QP, ub
= huge(
0._QP), tol
= sqrt(
epsilon(
1._QP)), nref
= 10_IK, interval
= nexp_type(), relerr
= relerr_QP, neval
= neval)
124if (relerr_QP
< 0._QP)
error stop 'Integration failed to converge.'
126+0.975928566535230134937169834879257738E17
130+1.00000000047261839211598849473494003
 Test:
 test_pm_quadRomb
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.

If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
 Copyright
 Computational Data Science Lab
 Author:
 Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
Definition at line 169 of file pm_quadRomb.F90.