anchor.diff:           api_eq/1, reference/1,
   	 basic_stats_uniform_1/1, basic_stats_uniform_2/1,
   	 basic_stats_normal/1,
  -	 plugin/1, measure/1]).
  +	 plugin/1, measure/1, reference_jump/1]).
   
   -export([test/0, gen/1]).
   
  
positive.code:      api_eq,
       reference,
       {group, basic_stats},
       plugin, measure].
  
  groups() ->
      [{basic_stats, [parallel],
  
negative.code: 	    exit({error, Res, State0})
      end;
  measure_2(0, _, _) -> ok.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  -define(LOOP_JUMP, 1000).
  
  %% Check if exs64 algorithm generates the proper jump sequence.
  reference_jump(Config) when is_list(Config) ->
      [reference_jump_1(Alg) || Alg <- algs()],
      ok.
  
  reference_jump_1(Alg) ->
      Refval  = reference_jump_val(Alg),
      Testval = gen_jump(Alg),
      case Refval =:= Testval of
          true -> ok;
          false ->
  	    io:format("Failed: ~p~n",[Alg]),
  	    io:format("Length ~p ~p~n",[length(Refval), length(Testval)]),
  	    io:format("Head ~p ~p~n",[hd(Refval), hd(Testval)]),
  	    ok
      end.
  
  gen_jump(Algo) ->
      Seed = case Algo of
  	       exsplus -> %% Printed with orig 'C' code and this seed
  		   rand:seed_s({exsplus, [12345678|12345678]});
  	       exs64 -> %% Printed with orig 'C' code and this seed
  		   rand:seed_s({exs64, 12345678});
  	       exs1024 -> %% Printed with orig 'C' code and this seed
  		   rand:seed_s({exs1024, {lists:duplicate(16, 12345678), []}});
  	       _ ->
  		   rand:seed(Algo, {100, 200, 300})
  	   end,
      gen_jump(?LOOP_JUMP, Seed, []).
  
  gen_jump(N, State0 = {#{max:=Max}, _}, Acc) when N > 0 ->
      {_, State1} = rand:uniform_s(Max, State0),
      {Random, State2} = rand:uniform_s(Max, rand:jump(State1)),
      case N rem (?LOOP_JUMP div 100) of
  	0 -> gen_jump(N-1, State2, [Random|Acc]);
  	_ -> gen_jump(N-1, State2, Acc)
      end;
  gen_jump(_, _, Acc) -> lists:reverse(Acc).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% Data
  