anchor.diff:      R3 = R2 bxor (R2 bsr 27),
       {(R3 * 2685821657736338717) band ?UINT64MASK, R3}.
   
  -%%-----------------------------------------------------------------------
  -
  -%% algorithm handler functions
  -
  -%% Set the seed value to xorshift64star state in the process directory
  -%% with the given three unsigned 32-bit integer arguments
  -%% Multiplicands here: three 32-bit primes
  -
  -exs64_seed({A1, A2, A3}) ->
  -    {V1, _} = exs64_next(((A1 band ?UINT32MASK) * 4294967197 + 1)),
  -    {V2, _} = exs64_next(((A2 band ?UINT32MASK) * 4294967231 + 1)),
  -    {V3, _} = exs64_next(((A3 band ?UINT32MASK) * 4294967279 + 1)),
  -    ((V1 * V2 * V3) rem (?UINT64MASK - 1)) + 1.
  -
  -%% Generate float from given xorshift64star internal state.
  -
   exs64_uniform(R0) ->
       {V, R1} = exs64_next(R0),
       {V / 18446744073709551616.0, R1}.
   
  -%% Generate integer from given xorshift64star internal state.
  -
   exs64_uniform(Max, R) ->
       {V, R1} = exs64_next(R),
       {(V rem Max) + 1, R1}.
  
positive.code:        uniform_n=>fun exs1024_uniform/2},
       fun exs1024_seed/1}.
  
  %% =====================================================================
  %% exs64 PRNG: Xorshift*64
  %% Algorithm by Sebastiano Vigna
  %% Reference URL: http://xorshift.di.unimi.it/
  %% =====================================================================
  
  %% uint64(). 64bit unsigned integer type.
  
  -type uint64() :: 0..16#ffffffffffffffff.
  
  %% exs64_state(). Internal state data type for exs64.
  %% Internally represented as the record <code>#state{}</code>,
  %% of the 128bit seed.
  
  -type exs64_state() :: uint64().
  
  -define(UINT32MASK, 16#ffffffff).
  -define(UINT39MASK, 16#0000007fffffffff).
  -define(UINT64MASK, 16#ffffffffffffffff).
  
  %% Advance xorshift64star state for one step.
  %% and generate 64bit unsigned integer from
  %% the xorshift64star internal state.
  
  -spec exs64_next(exs64_state()) ->
          {uint64(), exs64_state()}.
  
  exs64_next(R) ->
      R1 = R bxor (R bsr 12),
  
negative.code: exs1024_next({[H], RL}) ->
      exs1024_next({[H|lists:reverse(RL)], []}).
  
  exs1024_uniform(R0) ->
      {V, R1} = exs1024_next(R0),
      {V / 18446744073709551616.0, R1}.
  
  exs1024_uniform(Max, R) ->
      {V, R1} = exs1024_next(R),
      {(V rem Max) + 1, R1}.
  