anchor.diff:              end
       end.
   
  --spec generator(generator_state()) -> any().
  +-spec generator(generator_state()) -> ok.
   generator({ DS, CalcFun, NextFun }) ->
       receive
           {next, Pid} ->
  
positive.code:                            UseApprox :: boolean()
                            }.
  
  -type distribution_fun() :: fun(() -> {ok, float()} | {last, float()}).
  -type distribution_state() :: binomial_state(). %or others
  -type generator_state() :: { State       :: distribution_state(),
                               CalcFun     :: fun((distribution_state()) -> any()),
                               NewStateFun :: fun((distribution_state()) -> distribution_state() | exit)}.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
negative.code: 
  % @doc apprxoimation is good if this conditions hold
  %      SRC: http://www.vosesoftware.com/ModelRiskHelp/index.htm#Distributions/Approximating_one_distribution_with_another/Approximations_to_the_Binomial_Distribution.htm
  -spec approx_valid(pos_integer(), float()) -> boolean().
  approx_valid(_N, 0) -> false;
  approx_valid(_N, 1) -> false;
  approx_valid(N, P) ->
  