/ acos.s (emx+gcc) -- Copyright (c) 1991-1993 by Eberhard Mattes

#include <libm.h>

        .globl  FUN(acos)

        .text

        .align  2, 0x90

/ double acos (double x)

/ acos(x) = atan2 (sqrt (1-x*x), x)

#define x       4(%esp)

DEF(acos)
        FLD     x                       / x
        fld     %st
        fmulp
        fsubrl  __const_ONE
        fsqrt
        FLD     x                       / x
        fpatan
        _xam
        j_nan   1f
        ret

        .align  2, 0x90
1:      SETERRNO($EDOM)
        ret
