2001-05-06 17:03:45 +00:00
|
|
|
/*
|
|
|
|
* Public domain.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <math_private.h>
|
2019-07-16 15:17:22 +00:00
|
|
|
#include <libm-alias-finite.h>
|
2001-05-06 17:03:45 +00:00
|
|
|
|
|
|
|
long double
|
|
|
|
__ieee754_acosl (long double x)
|
|
|
|
{
|
|
|
|
long double res;
|
|
|
|
|
2012-04-30 18:56:39 +00:00
|
|
|
/* acosl = atanl (sqrtl((1-x) (1+x)) / x) */
|
2001-05-06 17:03:45 +00:00
|
|
|
asm ( "fld %%st\n"
|
|
|
|
"fld1\n"
|
2012-04-30 18:56:39 +00:00
|
|
|
"fsubp\n"
|
|
|
|
"fld1\n"
|
|
|
|
"fadd %%st(2)\n"
|
|
|
|
"fmulp\n" /* 1 - x^2 */
|
2001-05-06 17:03:45 +00:00
|
|
|
"fsqrt\n" /* sqrtl (1 - x^2) */
|
2012-04-30 09:38:06 +00:00
|
|
|
"fabs\n"
|
2001-05-06 17:03:45 +00:00
|
|
|
"fxch %%st(1)\n"
|
|
|
|
"fpatan"
|
|
|
|
: "=t" (res) : "0" (x) : "st(1)");
|
|
|
|
return res;
|
|
|
|
}
|
2019-07-16 15:17:22 +00:00
|
|
|
libm_alias_finite (__ieee754_acosl, __acosl)
|