function [dasinhresult,x]=dasinh(x);
dasinhresult=[];
persistent aln2 asnhcs first firstCall nterms sqeps xmax y ; if isempty(firstCall),firstCall=1;end;
;
if isempty(nterms), nterms=0; end;
%***BEGIN PROLOGUE DASINH
%***PURPOSE Compute the arc hyperbolic sine.
%***LIBRARY SLATEC (FNLIB)
%***CATEGORY C4C
%***TYPE doubleprecision (ASINH-S, DASINH-D, CASINH-C)
%***KEYWORDS ARC HYPERBOLIC SINE, ASINH, ELEMENTARY FUNCTIONS, FNLIB,
% INVERSE HYPERBOLIC SINE
%***AUTHOR Fullerton, W., (LANL)
%***DESCRIPTION
%
% DASINH(X) calculates the doubleprecision arc hyperbolic
% sine for doubleprecision argument X.
%
%***REFERENCES (NONE)
%***ROUTINES CALLED D1MACH, DCSEVL, INITDS
%***REVISION HISTORY (YYMMDD)
% 770601 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)
%***end PROLOGUE DASINH
if isempty(asnhcs), asnhcs=zeros(1,39); end;
if isempty(aln2), aln2=0; end;
if isempty(sqeps), sqeps=0; end;
if isempty(xmax), xmax=0; end;
if isempty(y), y=0; end;
if isempty(first), first=false; end;
if firstCall, asnhcs(1)=[-.12820039911738186343372127359268d+0]; end;
if firstCall, asnhcs(2)=[-.58811761189951767565211757138362d-1]; end;
if firstCall, asnhcs(3)=[+.47274654322124815640725249756029d-2]; end;
if firstCall, asnhcs(4)=[-.49383631626536172101360174790273d-3]; end;
if firstCall, asnhcs(5)=[+.58506207058557412287494835259321d-4]; end;
if firstCall, asnhcs(6)=[-.74669983289313681354755069217188d-5]; end;
if firstCall, asnhcs(7)=[+.10011693583558199265966192015812d-5]; end;
if firstCall, asnhcs(8)=[-.13903543858708333608616472258886d-6]; end;
if firstCall, asnhcs(9)=[+.19823169483172793547317360237148d-7]; end;
if firstCall, asnhcs(10)=[-.28847468417848843612747272800317d-8]; end;
if firstCall, asnhcs(11)=[+.42672965467159937953457514995907d-9]; end;
if firstCall, asnhcs(12)=[-.63976084654366357868752632309681d-10]; end;
if firstCall, asnhcs(13)=[+.96991686089064704147878293131179d-11]; end;
if firstCall, asnhcs(14)=[-.14844276972043770830246658365696d-11]; end;
if firstCall, asnhcs(15)=[+.22903737939027447988040184378983d-12]; end;
if firstCall, asnhcs(16)=[-.35588395132732645159978942651310d-13]; end;
if firstCall, asnhcs(17)=[+.55639694080056789953374539088554d-14]; end;
if firstCall, asnhcs(18)=[-.87462509599624678045666593520162d-15]; end;
if firstCall, asnhcs(19)=[+.13815248844526692155868802298129d-15]; end;
if firstCall, asnhcs(20)=[-.21916688282900363984955142264149d-16]; end;
if firstCall, asnhcs(21)=[+.34904658524827565638313923706880d-17]; end;
if firstCall, asnhcs(22)=[-.55785788400895742439630157032106d-18]; end;
if firstCall, asnhcs(23)=[+.89445146617134012551050882798933d-19]; end;
if firstCall, asnhcs(24)=[-.14383426346571317305551845239466d-19]; end;
if firstCall, asnhcs(25)=[+.23191811872169963036326144682666d-20]; end;
if firstCall, asnhcs(26)=[-.37487007953314343674570604543999d-21]; end;
if firstCall, asnhcs(27)=[+.60732109822064279404549242880000d-22]; end;
if firstCall, asnhcs(28)=[-.98599402764633583177370173440000d-23]; end;
if firstCall, asnhcs(29)=[+.16039217452788496315232638293333d-23]; end;
if firstCall, asnhcs(30)=[-.26138847350287686596716134399999d-24]; end;
if firstCall, asnhcs(31)=[+.42670849606857390833358165333333d-25]; end;
if firstCall, asnhcs(32)=[-.69770217039185243299730773333333d-26]; end;
if firstCall, asnhcs(33)=[+.11425088336806858659812693333333d-26]; end;
if firstCall, asnhcs(34)=[-.18735292078860968933021013333333d-27]; end;
if firstCall, asnhcs(35)=[+.30763584414464922794065920000000d-28]; end;
if firstCall, asnhcs(36)=[-.50577364031639824787046399999999d-29]; end;
if firstCall, asnhcs(37)=[+.83250754712689142224213333333333d-30]; end;
if firstCall, asnhcs(38)=[-.13718457282501044163925333333333d-30]; end;
if firstCall, asnhcs(39)=[+.22629868426552784104106666666666d-31]; end;
if firstCall, aln2=[0.69314718055994530941723212145818d0]; end;
if firstCall, first=[true]; end;
firstCall=0;
%***FIRST EXECUTABLE STATEMENT DASINH
if( first )
[nterms ,asnhcs]=initds(asnhcs,39,0.1.*real(d1mach(3)));
sqeps = sqrt(d1mach(3));
xmax = 1.0d0./sqeps;
end;
first = false;
%
y = abs(x);
if( y>1.0d0 )
if( y<xmax )
dasinhresult = log(y+sqrt(y.*y+1.0d0));
end;
if( y>=xmax )
dasinhresult = aln2 + log(y);
end;
dasinhresult = (abs(dasinhresult).*sign(x));
else;
%
dasinhresult = x;
if( y>sqeps )
dasinhresult = x.*(1.0d0+dcsevl(2.0d0.*x.*x-1.0d0,asnhcs,nterms));
end;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',x); evalin('caller',[inputname(1),'=FUntemp;']); end
return;
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 DASUM