function value = formula_01 ( bvec )

%*****************************************************************************80
%
%% formula_01() returns the value of a circuit for a given input set.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 October 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Michael Quinn,
%    Parallel Programming in C with MPI and OpenMP,
%    McGraw-Hill, 2004,
%    ISBN13: 978-0071232654,
%    LC: QA76.73.C15.Q55.
%
%  Input:
%
%    integer BVEC(N), the binary inputs.
%
%  Output:
%
%    integer VALUE: the output of the circuit.
%
  value = ...
      (  bvec(1)  |  bvec(2)  ) ...
    & ( ~bvec(2)  | ~bvec(4)  ) ...
    & (  bvec(3)  |  bvec(4)  ) ...
    & ( ~bvec(4)  | ~bvec(5)  ) ...
    & (  bvec(5)  | ~bvec(6)  ) ...
    & (  bvec(6)  | ~bvec(7)  ) ...
    & (  bvec(6)  |  bvec(7)  ) ...
    & (  bvec(7)  | ~bvec(16) ) ...
    & (  bvec(8)  | ~bvec(9)  ) ...
    & ( ~bvec(8)  | ~bvec(14) ) ...
    & (  bvec(9)  |  bvec(10) ) ...
    & (  bvec(9)  | ~bvec(10) ) ...
    & ( ~bvec(10) | ~bvec(11) ) ...
    & (  bvec(10) |  bvec(12) ) ...
    & (  bvec(11) |  bvec(12) ) ...
    & (  bvec(13) |  bvec(14) ) ...
    & (  bvec(14) | ~bvec(15) ) ...
    & (  bvec(15) |  bvec(16) ) ...
    & (  bvec(15) |  bvec(17) ) ...
    & (  bvec(18) |  bvec(2)  ) ...
    & (  bvec(19) | ~bvec(1)  ) ...
    & (  bvec(20) |  bvec(2)  ) ...
    & (  bvec(20) | ~bvec(19) ) ...
    & ( ~bvec(20) | ~bvec(10) ) ...
    & (  bvec(1)  |  bvec(18) ) ...
    & ( ~bvec(2)  |  bvec(21) ) ...
    & ( ~bvec(22) |  bvec(21) ) ...
    & ( ~bvec(23) |  bvec(21) ) ...
    & ( ~bvec(22) | ~bvec(21) ) ...
    & (  bvec(23) | ~bvec(21) );

  return
end
 
