anchor.diff:  exs1024_next({[H], RL}) ->
       exs1024_next({[H|lists:reverse(RL)], []}).
   
  -%% Generate a list of 16 64-bit element list
  -%% of the xorshift64star random sequence
  -%% from a given 64-bit seed.
  -%% Note: dependent on exs64_next/1
  -
  --spec exs1024_gen1024(uint64()) -> list(uint64()).
  -
  -exs1024_gen1024(R) ->
  -        exs1024_gen1024(16, R, []).
  -
  --spec exs1024_gen1024(
  -        non_neg_integer(), uint64(), list(uint64())) ->
  -            list(uint64()).
  -
  -exs1024_gen1024(0, _, L) ->
  -    L;
  -exs1024_gen1024(N, R, L) ->
  -    {X, R2} = exs64_next(R),
  -    exs1024_gen1024(N - 1, R2, [X|L]).
  -
  -%%-----------------------------------------------------------------------
  -
  -%% algorithm handler functions
  -
  --define(UINT21MASK, 16#1fffff).
  -
  -%% Set the seed value to xorshift1024star state in the process directory
  -%% with the given three unsigned 21-bit integer arguments
  -%% Multiplicands here are three 21-bit primes.
  -%% TODO: this seeding has a room to improve.
  -
  -exs1024_seed({A1, A2, A3}) ->
  -    B1 = (((A1 band ?UINT21MASK) + 1) * 2097131) band ?UINT21MASK,
  -    B2 = (((A2 band ?UINT21MASK) + 1) * 2097133) band ?UINT21MASK,
  -    B3 = (((A3 band ?UINT21MASK) + 1) * 2097143) band ?UINT21MASK,
  -    {exs1024_gen1024(
  -		(B1 bsl 43) bor (B2 bsl 22) bor (B3 bsl 1) bor 1), []}.
  -
  -%% Generate float from given xorshift1024star internal state.
  -
   exs1024_uniform(R0) ->
       {V, R1} = exs1024_next(R0),
       {V / 18446744073709551616.0, R1}.
   
  -%% Generate integer from given xorshift1024star internal state.
  -
   exs1024_uniform(Max, R) ->
       {V, R1} = exs1024_next(R),
       {(V rem Max) + 1, R1}.
  
positive.code: 			    tl(R1)]),
      R2.
  
  %% Generate float from given xorshift128plus internal state.
  
  exsplus_uniform(R0) ->
      {I, R1} = exsplus_next(R0),
      {I / 18446744073709551616.0, R1}.
  
  %% Generate integer from given xorshift128plus internal state.
  
  exsplus_uniform(Max, R) ->
      {V, R1} = exsplus_next(R),
      {(V rem Max) + 1, R1}.
  
negative.code: %% Reference URL: http://xorshift.di.unimi.it/
  %% =====================================================================
  
  -type exs1024_state() :: {list(uint64()), list(uint64())}.
  
  %% TODO: this seeding has a room to improve.
  exs1024_seed({A1, A2, A3}) ->
      B1 = (((A1 band ?UINT21MASK) + 1) * 2097131) band ?UINT21MASK,
      B2 = (((A2 band ?UINT21MASK) + 1) * 2097133) band ?UINT21MASK,
      B3 = (((A3 band ?UINT21MASK) + 1) * 2097143) band ?UINT21MASK,
      {exs1024_gen1024(
  		    (B1 bsl 43) bor (B2 bsl 22) bor (B3 bsl 1) bor 1), []}.
  
  %% Generate a list of 16 64-bit element list
  %% of the xorshift64star random sequence
  %% from a given 64-bit seed.
  %% Note: dependent on exs64_next/1
  
  -spec exs1024_gen1024(uint64()) -> list(uint64()).
  
  exs1024_gen1024(R) ->
      exs1024_gen1024(16, R, []).
  
  exs1024_gen1024(0, _, L) ->
      L;
  exs1024_gen1024(N, R, L) ->
      {X, R2} = exs64_next(R),
      exs1024_gen1024(N - 1, R2, [X|L]).
  
  %% Calculation of xorshift1024star.
  %% exs1024_calc(S0, S1) -> {X, NS1}.
  %% X: random number output
  
  -spec exs1024_calc(uint64(), uint64()) -> {uint64(), uint64()}.
  exs1024_calc(S0, S1) ->
      S11 = S1 bxor ((S1 band ?UINT33MASK) bsl 31),
      S12 = S11 bxor (S11 bsr 11),
  