function value = c4_cos ( z )

%*****************************************************************************80
%
%% c4_cos() evaluates the cosine of a C4 argument.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 October 2011
%
%  Author:
%
%    Original FORTRAN77 version by Wayne Fullerton.
%    MATLAB version by John Burkardt.
%
%  Reference:
%
%    Wayne Fullerton,
%    Portable Special Function Routines,
%    in Portability of Numerical Software,
%    edited by Wayne Cowell,
%    Lecture Notes in Computer Science, Volume 57,
%    Springer 1977,
%    ISBN: 978-3-540-08446-4,
%    LC: QA297.W65.
%
%  Input:
%
%    complex Z, the argument.
%
%  Output:
%
%    complex VALUE, the cosine of Z.
%
  x = real ( z );
  y = imag ( z );

  cs = cos ( x );

  value = complex ( cs * cosh ( y ), - sin ( x ) * sinh ( y ) );

  return
end
