function [acoshresult,x]=acosh(x);
acoshresult=[];
persistent acosh aln2 firstCall xmax ; if isempty(firstCall),firstCall=1;end;
if isempty(acoshresult), acoshresult=0; end;
if isempty(aln2), aln2=0; end;
if isempty(xmax), xmax=0; end;
%***BEGIN PROLOGUE ACOSH
%***PURPOSE Compute the arc hyperbolic cosine.
%***LIBRARY SLATEC (FNLIB)
%***CATEGORY C4C
%***TYPE SINGLE PRECISION (ACOSH-S, DACOSH-D, CACOSH-C)
%***KEYWORDS ACOSH, ARC HYPERBOLIC COSINE, ELEMENTARY FUNCTIONS, FNLIB,
% INVERSE HYPERBOLIC COSINE
%***AUTHOR Fullerton, W., (LANL)
%***DESCRIPTION
%
% ACOSH(X) computes the arc hyperbolic cosine of X.
%
%***REFERENCES (NONE)
%***ROUTINES CALLED R1MACH, XERMSG
%***REVISION HISTORY (YYMMDD)
% 770401 DATE WRITTEN
% 890531 Changed all specific intrinsics to generic. (WRB)
% 890531 REVISION DATE from Version 3.2
% 891214 Prologue converted to Version 4.0 format. (BAB)
% 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
% 900326 Removed duplicate information from DESCRIPTION section.
% (WRB)
%***end PROLOGUE ACOSH
if firstCall, aln2=[0.69314718055994530942e0]; end;
if firstCall, xmax=[0.]; end;
firstCall=0;
%***FIRST EXECUTABLE STATEMENT ACOSH
if( xmax==0. )
xmax = 1.0./sqrt(r1mach(3));
end;
%
if( x<1.0 )
xermsg('SLATEC','ACOSH','X LESS THAN 1',1,2);
end;
%
if( x<xmax )
acoshresult = log(x+sqrt(x.*x-1.0));
end;
if( x>=xmax )
acoshresult = aln2 + log(x);
end;
%
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',x); evalin('caller',[inputname(1),'=FUntemp;']); end
end
%DECK AIE