home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / MATH / ACOS.S next >
Encoding:
Text File  |  1993-01-02  |  558 b   |  32 lines

  1. / acos.s (emx+gcc) -- Copyright (c) 1991-1993 by Eberhard Mattes
  2.  
  3. #include <libm.h>
  4.  
  5.         .globl  _acos
  6.  
  7.         .text
  8.  
  9.         .align  2, 0x90
  10.  
  11. / double acos (double x)
  12.  
  13. / acos(x) = atan2 (sqrt (1-x*x), x)
  14.  
  15. #define x       4(%esp)
  16.  
  17. _acos:
  18.         fldl    x                       / x
  19.         fld     %st
  20.         fmulp
  21.         fsubrl  __const_ONE
  22.         fsqrt
  23.         fldl    x                       / x
  24.         fpatan
  25.         _xam
  26.         j_nan   1f
  27.         ret
  28.  
  29.         .align  2, 0x90
  30. 1:      SETERRNO($EDOM)
  31.         ret
  32.