anchor.diff:      if
           ?BIT(55) =< M1 ->
               %% We have 56 bits - waste 3
  -            {(M1 bsr 3) * math:pow(2.0, -53), {Alg, R1}};
  +            {(M1 bsr 3) * math:pow(2.0, -53), {AlgHandler, R1}};
           ?BIT(54) =< M1 ->
               %% We have 55 bits - waste 2
  -            {(M1 bsr 2) * math:pow(2.0, -54), {Alg, R1}};
  +            {(M1 bsr 2) * math:pow(2.0, -54), {AlgHandler, R1}};
           ?BIT(53) =< M1 ->
               %% We have 54 bits - waste 1
  -            {(M1 bsr 1) * math:pow(2.0, -55), {Alg, R1}};
  +            {(M1 bsr 1) * math:pow(2.0, -55), {AlgHandler, R1}};
           ?BIT(52) =< M1 ->
               %% We have 53 bits - use all
  -            {M1 * math:pow(2.0, -56), {Alg, R1}};
  +            {M1 * math:pow(2.0, -56), {AlgHandler, R1}};
           true ->
               %% Need more bits
               {V2, R2} = Next(R1),
  -            uniform_real_s(Alg, Next, M1, -56, R2, V2, Bits)
  +            uniform_real_s(AlgHandler, Next, M1, -56, R2, V2, Bits)
       end;
  -uniform_real_s({#{max:=_, next:=Next} = Alg, R0}) ->
  +uniform_real_s({#{max:=_, next:=Next} = AlgHandler, R0}) ->
       %% Generate a 56 bit number.
       %% Ignore the weak low bits for these old algorithms,
       %% just produce something reasonable.
  
positive.code: -spec uniform_s(State :: state()) -> {X :: float(), NewState :: state()}.
  uniform_s(State = {#{uniform:=Uniform}, _}) ->
      Uniform(State);
  uniform_s({#{bits:=Bits, next:=Next} = Alg, R0}) ->
      {V, R1} = Next(R0),
      %% Produce floats on the form N * 2^(-53)
      {(V bsr (Bits - 53)) * ?TWO_POW_MINUS53, {Alg, R1}};
  uniform_s({#{max:=Max, next:=Next} = Alg, R0}) ->
      {V, R1} = Next(R0),
      %% Old algorithm with non-uniform density
      {V / (Max + 1), {Alg, R1}}.
  
  
  %% uniform_s/2: given an integer N >= 1 and a state, uniform_s/2
  
negative.code: -define(NOR_INV_R, 1/?NOR_R).
  
  %% return a {sign, Random51bits, State}
  get_52({#{bits:=Bits, next:=Next} = AlgHandler, S0}) ->
      %% Use the high bits
      {Int,S1} = Next(S0),
      {?BIT(Bits - 51 - 1) band Int, Int bsr (Bits - 51), {AlgHandler, S1}};
  get_52({#{next:=Next} = AlgHandler, S0}) ->
      {Int,S1} = Next(S0),
      {?BIT(51) band Int, ?MASK(51, Int), {AlgHandler, S1}}.
  
  %% Slow path
  normal_s(0, Sign, X0, State0) ->
  