      FUNCTION ACOS (X)
C
*	This routine lifted from GEOLB.FOR, provided by R. C.
*	Livingston, SRI International, January 1987. It is called by
*	DIPL85 in [STEELE.UTILITIES]RTNLIB. 
*
      Z=ABS (X)
      IF (Z -    1.0) 5,5,1
  1   IF ((Z-1.0) -    0.0000005) 4,4,2
    2 CONTINUE
* 3   FORMAT (38H ARGUMENT IN ACOS(X) OR ASIN(X) WAS X=,E18.10,31H   1.0
*    A OR -1.0 WAS SUBSTITUTED.)         
  4   Z=1.0
  5   Y=((((((-0.0012624911*Z+.0066700901)*Z-.0170881256)*Z+.0308918810)
     1*Z-.0501743046)*Z+.0889789874)*Z-.2145988016)*Z+1.5707963050
      ACOS =SQRT (1.0-Z)*Y
      IF (X -    0.0) 6,7,7
  6   ACOS =3.1415926536-ACOS
  7   RETURN             
      END
