Skip to content

Commit e728ae0

Browse files
Update stdlib_stats_distribution_uniform.fypp
1 parent 615ac95 commit e728ae0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/stdlib_stats_distribution_uniform.fypp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ module stdlib_stats_distribution_uniform
180180
!
181181
${t1}$, intent(in) :: scale
182182
${t1}$ :: res
183-
real(${k1}$) :: r1, r2, tr, ti
183+
real(${k1}$) :: r1, tr, ti
184184

185185
if(scale == (0.0_${k1}$, 0.0_${k1}$)) call error_stop("Error(uni_dist_" &
186186
//"rvs_1): Uniform distribution scale parameter must be non-zero")
@@ -192,9 +192,9 @@ module stdlib_stats_distribution_uniform
192192
tr = scale % re * r1
193193
ti = 0.0_${k1}$
194194
else
195-
r2 = unif_dist_rvs_0_r${k1}$( )
196-
tr = scale % re * r1
197-
ti = scale % im * r2
195+
tr = scale % re * r1
196+
r1 = unif_dist_rvs_0_r${k1}$( )
197+
ti = scale % im * r1
198198
endif
199199
res = cmplx(tr, ti, kind=${k1}$)
200200
end function unif_dist_rvs_1_${t1[0]}$${k1}$
@@ -211,7 +211,7 @@ module stdlib_stats_distribution_uniform
211211
!
212212
${t1}$, intent(in) :: loc, scale
213213
${t1}$ :: res
214-
real(${k1}$) :: r1, r2, tr, ti
214+
real(${k1}$) :: r1, tr, ti
215215

216216
if(scale == (0.0_${k1}$, 0.0_${k1}$)) call error_stop("Error(uni_dist_" &
217217
//"rvs): Uniform distribution scale parameter must be non-zero")
@@ -223,9 +223,9 @@ module stdlib_stats_distribution_uniform
223223
tr = loc % re + scale % re * r1
224224
ti = loc % im
225225
else
226-
r2 = unif_dist_rvs_0_r${k1}$( )
227226
tr = loc % re + scale % re * r1
228-
ti = loc % im + scale % im * r2
227+
r1 = unif_dist_rvs_0_r${k1}$( )
228+
ti = loc % im + scale % im * r1
229229
endif
230230
res = cmplx(tr, ti, kind=${k1}$)
231231
end function unif_dist_rvs_${t1[0]}$${k1}$
@@ -295,7 +295,7 @@ module stdlib_stats_distribution_uniform
295295
integer, intent(in) :: array_size
296296
${t1}$, intent(in) :: loc, scale
297297
${t1}$ :: res(array_size)
298-
real(${k1}$) :: r1, r2, tr, ti
298+
real(${k1}$) :: r1, tr, ti
299299
integer(int64) :: tmp
300300
integer :: i
301301

@@ -312,10 +312,10 @@ module stdlib_stats_distribution_uniform
312312
tr = loc % re + scale % re * r1
313313
ti = loc % im
314314
else
315-
tmp = shiftr(dist_rand(INT_ONE), 11)
316-
r2 = real(tmp * MESENNE_NUMBER, kind = ${k1}$)
317315
tr = loc % re + scale % re * r1
318-
ti = loc % im + scale % im * r2
316+
tmp = shiftr(dist_rand(INT_ONE), 11)
317+
r1 = real(tmp * MESENNE_NUMBER, kind = ${k1}$)
318+
ti = loc % im + scale % im * r1
319319
endif
320320
res(i) = cmplx(tr, ti, kind=${k1}$)
321321
end do

0 commit comments

Comments
 (0)