function value = r8vec_softmax ( n, x )

%*****************************************************************************80
%
%% r8vec_softmax() evaluates the SOFTMAX function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 August 2018
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the size of the vector.
%
%    real X(N), the vector.
%
%  Output:
%
%    real VALUE(N), the function values.
%
  [ ~, index ] = max ( x );
  bottom = sum ( exp ( x(1:n) - x(index) ) );
  value(1:n) = exp ( x(1:n) - x(index) ) / bottom;

  return
end
