1
- #:set WITH_QP = False
2
- #:set WITH_XDP = False
3
1
#:include "common.fypp"
4
- #:set CI_KINDS_TYPES = INT_KINDS_TYPES + CMPLX_KINDS_TYPES
2
+ #:set R_KINDS_TYPES = [KT for KT in REAL_KINDS_TYPES if KT[0] in ["sp","dp"]]
3
+ #:set C_KINDS_TYPES = [KT for KT in CMPLX_KINDS_TYPES if KT[0] in ["sp","dp"]]
4
+ #:set CI_KINDS_TYPES = INT_KINDS_TYPES + C_KINDS_TYPES
5
5
module stdlib_specialfunctions_gamma
6
6
use iso_fortran_env, only : qp => real128
7
7
use stdlib_kinds, only : sp, dp, int8, int16, int32, int64
@@ -15,7 +15,7 @@ module stdlib_specialfunctions_gamma
15
15
integer(int32), parameter :: max_fact_int32 = 13_int32
16
16
integer(int64), parameter :: max_fact_int64 = 21_int64
17
17
18
- #:for k1, t1 in REAL_KINDS_TYPES
18
+ #:for k1, t1 in R_KINDS_TYPES
19
19
${t1}$, parameter :: tol_${k1}$ = epsilon(1.0_${k1}$)
20
20
#:endfor
21
21
real(qp), parameter :: tol_qp = epsilon(1.0_qp)
@@ -63,12 +63,12 @@ module stdlib_specialfunctions_gamma
63
63
!! Lower incomplete gamma function
64
64
!!
65
65
#:for k1, t1 in INT_KINDS_TYPES
66
- #:for k2, t2 in REAL_KINDS_TYPES
66
+ #:for k2, t2 in R_KINDS_TYPES
67
67
module procedure ingamma_low_${t1[0]}$${k1}$${k2}$
68
68
#:endfor
69
69
#:endfor
70
70
71
- #:for k1, t1 in REAL_KINDS_TYPES
71
+ #:for k1, t1 in R_KINDS_TYPES
72
72
module procedure ingamma_low_${t1[0]}$${k1}$
73
73
#:endfor
74
74
end interface lower_incomplete_gamma
@@ -79,12 +79,12 @@ module stdlib_specialfunctions_gamma
79
79
!! Logarithm of lower incomplete gamma function
80
80
!!
81
81
#:for k1, t1 in INT_KINDS_TYPES
82
- #:for k2, t2 in REAL_KINDS_TYPES
82
+ #:for k2, t2 in R_KINDS_TYPES
83
83
module procedure l_ingamma_low_${t1[0]}$${k1}$${k2}$
84
84
#:endfor
85
85
#:endfor
86
86
87
- #:for k1, t1 in REAL_KINDS_TYPES
87
+ #:for k1, t1 in R_KINDS_TYPES
88
88
module procedure l_ingamma_low_${t1[0]}$${k1}$
89
89
#:endfor
90
90
end interface log_lower_incomplete_gamma
@@ -95,12 +95,12 @@ module stdlib_specialfunctions_gamma
95
95
!! Upper incomplete gamma function
96
96
!!
97
97
#:for k1, t1 in INT_KINDS_TYPES
98
- #:for k2, t2 in REAL_KINDS_TYPES
98
+ #:for k2, t2 in R_KINDS_TYPES
99
99
module procedure ingamma_up_${t1[0]}$${k1}$${k2}$
100
100
#:endfor
101
101
#:endfor
102
102
103
- #:for k1, t1 in REAL_KINDS_TYPES
103
+ #:for k1, t1 in R_KINDS_TYPES
104
104
module procedure ingamma_up_${t1[0]}$${k1}$
105
105
#:endfor
106
106
end interface upper_incomplete_gamma
@@ -111,12 +111,12 @@ module stdlib_specialfunctions_gamma
111
111
!! Logarithm of upper incomplete gamma function
112
112
!!
113
113
#:for k1, t1 in INT_KINDS_TYPES
114
- #:for k2, t2 in REAL_KINDS_TYPES
114
+ #:for k2, t2 in R_KINDS_TYPES
115
115
module procedure l_ingamma_up_${t1[0]}$${k1}$${k2}$
116
116
#:endfor
117
117
#:endfor
118
118
119
- #:for k1, t1 in REAL_KINDS_TYPES
119
+ #:for k1, t1 in R_KINDS_TYPES
120
120
module procedure l_ingamma_up_${t1[0]}$${k1}$
121
121
#:endfor
122
122
end interface log_upper_incomplete_gamma
@@ -127,12 +127,12 @@ module stdlib_specialfunctions_gamma
127
127
!! Regularized (normalized) lower incomplete gamma function, P
128
128
!!
129
129
#:for k1, t1 in INT_KINDS_TYPES
130
- #:for k2, t2 in REAL_KINDS_TYPES
130
+ #:for k2, t2 in R_KINDS_TYPES
131
131
module procedure regamma_p_${t1[0]}$${k1}$${k2}$
132
132
#:endfor
133
133
#:endfor
134
134
135
- #:for k1, t1 in REAL_KINDS_TYPES
135
+ #:for k1, t1 in R_KINDS_TYPES
136
136
module procedure regamma_p_${t1[0]}$${k1}$
137
137
#:endfor
138
138
end interface regularized_gamma_p
@@ -143,12 +143,12 @@ module stdlib_specialfunctions_gamma
143
143
!! Regularized (normalized) upper incomplete gamma function, Q
144
144
!!
145
145
#:for k1, t1 in INT_KINDS_TYPES
146
- #:for k2, t2 in REAL_KINDS_TYPES
146
+ #:for k2, t2 in R_KINDS_TYPES
147
147
module procedure regamma_q_${t1[0]}$${k1}$${k2}$
148
148
#:endfor
149
149
#:endfor
150
150
151
- #:for k1, t1 in REAL_KINDS_TYPES
151
+ #:for k1, t1 in R_KINDS_TYPES
152
152
module procedure regamma_q_${t1[0]}$${k1}$
153
153
#:endfor
154
154
end interface regularized_gamma_q
@@ -159,12 +159,12 @@ module stdlib_specialfunctions_gamma
159
159
! Incomplete gamma G function.
160
160
! Internal use only
161
161
!
162
- #:for k1, t1 in REAL_KINDS_TYPES
162
+ #:for k1, t1 in R_KINDS_TYPES
163
163
module procedure gpx_${t1[0]}$${k1}$ !for real p and x
164
164
#:endfor
165
165
166
166
#:for k1, t1 in INT_KINDS_TYPES
167
- #:for k2, t2 in REAL_KINDS_TYPES
167
+ #:for k2, t2 in R_KINDS_TYPES
168
168
module procedure gpx_${t1[0]}$${k1}$${k2}$ !for integer p and real x
169
169
#:endfor
170
170
#:endfor
@@ -177,7 +177,7 @@ module stdlib_specialfunctions_gamma
177
177
! Internal use only
178
178
!
179
179
#:for k1, t1 in INT_KINDS_TYPES
180
- #:for k2, t2 in REAL_KINDS_TYPES
180
+ #:for k2, t2 in R_KINDS_TYPES
181
181
module procedure l_gamma_${t1[0]}$${k1}$${k2}$
182
182
#:endfor
183
183
#:endfor
@@ -218,7 +218,7 @@ contains
218
218
219
219
220
220
221
- #:for k1, t1 in CMPLX_KINDS_TYPES
221
+ #:for k1, t1 in C_KINDS_TYPES
222
222
#:if k1 == "sp"
223
223
#:set k2 = "dp"
224
224
#:elif k1 == "dp"
@@ -373,7 +373,7 @@ contains
373
373
374
374
375
375
#:for k1, t1 in INT_KINDS_TYPES
376
- #:for k2, t2 in REAL_KINDS_TYPES
376
+ #:for k2, t2 in R_KINDS_TYPES
377
377
378
378
impure elemental function l_gamma_${t1[0]}$${k1}$${k2}$(z, x) result(res)
379
379
!
@@ -414,7 +414,7 @@ contains
414
414
415
415
416
416
417
- #:for k1, t1 in CMPLX_KINDS_TYPES
417
+ #:for k1, t1 in C_KINDS_TYPES
418
418
#:if k1 == "sp"
419
419
#:set k2 = "dp"
420
420
#:elif k1 == "dp"
@@ -556,7 +556,7 @@ contains
556
556
557
557
558
558
559
- #:for k1, t1 in REAL_KINDS_TYPES
559
+ #:for k1, t1 in R_KINDS_TYPES
560
560
#:if k1 == "sp"
561
561
#:set k2 = "dp"
562
562
#:elif k1 == "dp"
@@ -702,7 +702,7 @@ contains
702
702
703
703
704
704
#:for k1, t1 in INT_KINDS_TYPES
705
- #:for k2, t2 in REAL_KINDS_TYPES
705
+ #:for k2, t2 in R_KINDS_TYPES
706
706
impure elemental function gpx_${t1[0]}$${k1}$${k2}$(p, x) result(res)
707
707
!
708
708
! Approximation of incomplete gamma G function with integer argument p.
@@ -841,7 +841,7 @@ contains
841
841
842
842
843
843
844
- #:for k1, t1 in REAL_KINDS_TYPES
844
+ #:for k1, t1 in R_KINDS_TYPES
845
845
impure elemental function ingamma_low_${t1[0]}$${k1}$(p, x) result(res)
846
846
!
847
847
! Approximation of lower incomplete gamma function with real p.
@@ -878,7 +878,7 @@ contains
878
878
879
879
880
880
#:for k1, t1 in INT_KINDS_TYPES
881
- #:for k2, t2 in REAL_KINDS_TYPES
881
+ #:for k2, t2 in R_KINDS_TYPES
882
882
impure elemental function ingamma_low_${t1[0]}$${k1}$${k2}$(p, x) &
883
883
result(res)
884
884
!
@@ -918,7 +918,7 @@ contains
918
918
919
919
920
920
921
- #:for k1, t1 in REAL_KINDS_TYPES
921
+ #:for k1, t1 in R_KINDS_TYPES
922
922
impure elemental function l_ingamma_low_${t1[0]}$${k1}$(p, x) result(res)
923
923
924
924
${t1}$, intent(in) :: p, x
@@ -955,7 +955,7 @@ contains
955
955
956
956
957
957
#:for k1, t1 in INT_KINDS_TYPES
958
- #:for k2, t2 in REAL_KINDS_TYPES
958
+ #:for k2, t2 in R_KINDS_TYPES
959
959
impure elemental function l_ingamma_low_${t1[0]}$${k1}$${k2}$(p, x) &
960
960
result(res)
961
961
@@ -987,7 +987,7 @@ contains
987
987
988
988
989
989
990
- #:for k1, t1 in REAL_KINDS_TYPES
990
+ #:for k1, t1 in R_KINDS_TYPES
991
991
impure elemental function ingamma_up_${t1[0]}$${k1}$(p, x) result(res)
992
992
!
993
993
! Approximation of upper incomplete gamma function with real p.
@@ -1025,7 +1025,7 @@ contains
1025
1025
1026
1026
1027
1027
#:for k1, t1 in INT_KINDS_TYPES
1028
- #:for k2, t2 in REAL_KINDS_TYPES
1028
+ #:for k2, t2 in R_KINDS_TYPES
1029
1029
impure elemental function ingamma_up_${t1[0]}$${k1}$${k2}$(p, x) &
1030
1030
result(res)
1031
1031
!
@@ -1067,7 +1067,7 @@ contains
1067
1067
1068
1068
1069
1069
1070
- #:for k1, t1 in REAL_KINDS_TYPES
1070
+ #:for k1, t1 in R_KINDS_TYPES
1071
1071
impure elemental function l_ingamma_up_${t1[0]}$${k1}$(p, x) result(res)
1072
1072
1073
1073
${t1}$, intent(in) :: p, x
@@ -1105,7 +1105,7 @@ contains
1105
1105
1106
1106
1107
1107
#:for k1, t1 in INT_KINDS_TYPES
1108
- #:for k2, t2 in REAL_KINDS_TYPES
1108
+ #:for k2, t2 in R_KINDS_TYPES
1109
1109
impure elemental function l_ingamma_up_${t1[0]}$${k1}$${k2}$(p, x) &
1110
1110
result(res)
1111
1111
@@ -1146,7 +1146,7 @@ contains
1146
1146
1147
1147
1148
1148
1149
- #:for k1, t1 in REAL_KINDS_TYPES
1149
+ #:for k1, t1 in R_KINDS_TYPES
1150
1150
impure elemental function regamma_p_${t1[0]}$${k1}$(p, x) result(res)
1151
1151
!
1152
1152
! Approximation of regularized incomplete gamma function P(p,x) for real p
@@ -1181,7 +1181,7 @@ contains
1181
1181
1182
1182
1183
1183
#:for k1, t1 in INT_KINDS_TYPES
1184
- #:for k2, t2 in REAL_KINDS_TYPES
1184
+ #:for k2, t2 in R_KINDS_TYPES
1185
1185
impure elemental function regamma_p_${t1[0]}$${k1}$${k2}$(p, x) result(res)
1186
1186
!
1187
1187
! Approximation of regularized incomplete gamma function P(p,x) for integer p
@@ -1217,7 +1217,7 @@ contains
1217
1217
1218
1218
1219
1219
1220
- #:for k1, t1 in REAL_KINDS_TYPES
1220
+ #:for k1, t1 in R_KINDS_TYPES
1221
1221
impure elemental function regamma_q_${t1[0]}$${k1}$(p, x) result(res)
1222
1222
!
1223
1223
! Approximation of regularized incomplete gamma function Q(p,x) for real p
@@ -1252,7 +1252,7 @@ contains
1252
1252
1253
1253
1254
1254
#:for k1, t1 in INT_KINDS_TYPES
1255
- #:for k2, t2 in REAL_KINDS_TYPES
1255
+ #:for k2, t2 in R_KINDS_TYPES
1256
1256
impure elemental function regamma_q_${t1[0]}$${k1}$${k2}$(p, x) result(res)
1257
1257
!
1258
1258
! Approximation of regularized incomplet gamma function Q(p,x) for integer p
0 commit comments