1 | /* |
2 | * Public domain. |
3 | */ |
4 | |
5 | #include <machine/asm.h> |
6 | #include <libm-alias-finite.h> |
7 | |
8 | RCSID("$NetBSD: e_acos.S,v 1.4 1995/05/08 23:44:37 jtc Exp $" ) |
9 | |
10 | /* acos = atan (sqrt((1-x) (1+x)) / x) */ |
11 | ENTRY(__ieee754_acos) |
12 | fldl 4(%esp) /* x */ |
13 | fld %st /* x : x */ |
14 | fld1 /* 1 : x : x */ |
15 | fsubp /* 1 - x : x */ |
16 | fld1 /* 1 : 1 - x : x */ |
17 | fadd %st(2) /* 1 + x : 1 - x : x */ |
18 | fmulp /* 1 - x^2 : x */ |
19 | fsqrt /* sqrt (1 - x^2) : x */ |
20 | fabs |
21 | fxch %st(1) /* x : sqrt (1 - x^2) */ |
22 | fpatan /* atan (sqrt(1 - x^2) / x) */ |
23 | ret |
24 | END (__ieee754_acos) |
25 | libm_alias_finite (__ieee754_acos, __acos) |
26 | |