anchor.diff:  
   -spec new(precision()) -> filter().
   new(P) when 4 =< P andalso P =< 16 ->
  -    M = trunc(pow(2, P)),
  -    Registers = array:new([{size, M}, {fixed, true}, {default, 0}]),
  -    #hyper{p = P, registers = Registers}.
  +    #hyper{p = P, registers = gb_trees:empty()}.
   
   
   -spec insert(value(), filter()) -> filter().
  
positive.code: -spec card(filter()) -> float().
  card(#hyper{registers = Registers, p = P}) ->
      M = trunc(pow(2, P)),
      RegisterSum = lists:sum(lists:map(fun (Register) ->
                                                pow(2, -Register)
                                        end, array:to_list(Registers))),
  
      E = alpha(M) * pow(M, 2) / RegisterSum,
      Ep = case E =< 5 * M of
  
negative.code: union(#hyper{registers = LeftRegisters} = Left,
        #hyper{registers = RightRegisters} = Right)
    when Left#hyper.p =:= Right#hyper.p ->
      %% NewRegisters =
      %%     gb_trees:from_orddict(
      %%       orddict:merge(fun (_Index, L, R) -> max(L, R) end,
      %%                     gb_trees:to_list(LeftRegisters),
      %%                     gb_trees:to_list(RightRegisters))),
  
      NewRegisters = gb_fold(fun (Index, L, Registers) ->
                                     case gb_trees:lookup(Index, Registers) of
                                         {value, R} when R < L ->
                                             gb_trees:enter(Index, L, Registers);
                                         {value, _} ->
                                             Registers;
                                         none ->
                                             gb_trees:enter(Index, L, Registers)
                                     end
                             end, RightRegisters, LeftRegisters),
  
      Right#hyper{registers = NewRegisters}.
  
  
  gb_fold(F, A, {_, T}) when is_function(F, 3) ->
      gb_fold_1(F, A, T).
  
  gb_fold_1(F, Acc0, {Key, Value, Small, Big}) ->
      Acc1 = gb_fold_1(F, Acc0, Small),
      Acc = F(Key, Value, Acc1),
      gb_fold_1(F, Acc, Big);
  gb_fold_1(_, Acc, _) ->
      Acc.
  
  
  %% NOTE: use with caution, no guarantees on accuracy.
  