function value = virasoro_f ( m, n, x )

%*****************************************************************************80
%
%% virasoro_f() returns the function in the virasoro problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Sashwati Ray, PSV Nataraj,
%    An efficient algorithm for range computation of polynomials using the
%    Bernstein form,
%    Journal of Global Optimization,
%    Volume 45, 2009, pages 403-426.
%
%  Input:
%
%    integer M, the number of variables.
%
%    integer N, the number of points.
%
%    real X(M,N), the points.
%
%  Output:
%
%    real VALUE(N), the value of the function at X.
%
  value(1:n) = ( ...
    - 2.0E+00 * x(1,1:n)      .* x(4,1:n) ...
    + 2.0E+00 * x(1,1:n)      .* x(7,1:n) ...
    - 2.0E+00 * x(2,1:n)      .* x(5,1:n) ...
    + 2.0E+00 * x(2,1:n)      .* x(7,1:n) ...
    - 2.0E+00 * x(3,1:n)      .* x(6,1:n) ...
    + 2.0E+00 * x(3,1:n)      .* x(7,1:n) ...
    + 2.0E+00 * x(4,1:n)      .* x(7,1:n) ...
    + 2.0E+00 * x(5,1:n)      .* x(7,1:n) ...
    + 8.0E+00 * x(6,1:n)      .* x(7,1:n) ...
    - 6.0E+00 * x(6,1:n)      .* x(8,1:n) ...
    + 8.0E+00 * x(7,1:n) .^ 2             ...
    + 6.0E+00 * x(7,1:n)      .* x(8,1:n) ...
    -           x(7,1:n) )';

  return
end


