Blame sysdeps/i386/fpu/e_acos.S
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* Written by J.T. Conklin <jtc@netbsd.org>.
|
|
Packit |
6c4009 |
* Public domain.
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <machine/asm.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
RCSID("$NetBSD: e_acos.S,v 1.4 1995/05/08 23:44:37 jtc Exp $")
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* acos = atan (sqrt((1-x) (1+x)) / x) */
|
|
Packit |
6c4009 |
ENTRY(__ieee754_acos)
|
|
Packit |
6c4009 |
fldl 4(%esp) /* x */
|
|
Packit |
6c4009 |
fld %st /* x : x */
|
|
Packit |
6c4009 |
fld1 /* 1 : x : x */
|
|
Packit |
6c4009 |
fsubp /* 1 - x : x */
|
|
Packit |
6c4009 |
fld1 /* 1 : 1 - x : x */
|
|
Packit |
6c4009 |
fadd %st(2) /* 1 + x : 1 - x : x */
|
|
Packit |
6c4009 |
fmulp /* 1 - x^2 : x */
|
|
Packit |
6c4009 |
fsqrt /* sqrt (1 - x^2) : x */
|
|
Packit |
6c4009 |
fabs
|
|
Packit |
6c4009 |
fxch %st(1) /* x : sqrt (1 - x^2) */
|
|
Packit |
6c4009 |
fpatan /* atan (sqrt(1 - x^2) / x) */
|
|
Packit |
6c4009 |
ret
|
|
Packit |
6c4009 |
END (__ieee754_acos)
|
|
Packit |
6c4009 |
strong_alias (__ieee754_acos, __acos_finite)
|