function value = r8_cube_root ( x )

%*****************************************************************************80
%
%% r8_cube_root() returns the cube root of an R8.
%
%  Discussion:
%
%    This routine is designed to avoid the possible problems that can occur
%    when formulas like 0.0^(1/3) or (-1.0)^(1/3) are to be evaluated.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    08 May 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X, the number whose cube root is desired.
%
%  Output:
%
%    real VALUE, the cube root of X.
%
  if ( 0.0 < x )
    value = x .^ (1.0/3.0);
  elseif ( x == 0.0 )
    value = 0.0;
  else
    value = - ( abs ( x ) ) .^ (1.0/3.0);
  end

  return
end
