-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update stdlib_random.fypp change function `rtol` to fortran intrinsic `ishftc` * Update stdlib_random.fypp
- Loading branch information
Showing
1 changed file
with
2 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,27 +78,16 @@ module stdlib_random | |
integer(int64) :: res, t | ||
|
||
if(.not. seed_initialized) call random_distribution_seed_iint64(si,t) | ||
res = rol64(st(2) * 5, 7) * 9 | ||
res = ishftc(st(2) * 5, 7) * 9 | ||
t = shiftl(st(2), 17) | ||
st(3) = ieor(st(3), st(1)) | ||
st(4) = ieor(st(4), st(2)) | ||
st(2) = ieor(st(2), st(3)) | ||
st(1) = ieor(st(1), st(4)) | ||
st(3) = ieor(st(3), t) | ||
st(4) = rol64(st(4), 45) | ||
st(4) = ishftc(st(4), 45) | ||
end function xoshiro256ss | ||
|
||
pure function rol64(x, k) result(res) | ||
integer(int64), intent(in) :: x | ||
integer, intent(in) :: k | ||
integer(int64) :: t1, t2, res | ||
|
||
t1 = shiftr(x, (64 - k)) | ||
t2 = shiftl(x, k) | ||
res = ior(t1, t2) | ||
end function rol64 | ||
|
||
|
||
function splitmix64(s) result(res) | ||
! Written in 2015 by Sebastiano Vigna ([email protected]) | ||
! This is a fixed-increment version of Java 8's SplittableRandom | ||
|