1 /* 2 * Public domain. 3 * 4 */ 5 6 #include <math_private.h> 7 #include <libm-alias-finite.h> 8 9 long double __ieee754_acosl(long double x)10__ieee754_acosl (long double x) 11 { 12 long double res; 13 14 /* acosl = atanl (sqrtl((1-x) (1+x)) / x) */ 15 asm ( "fld %%st\n" 16 "fld1\n" 17 "fsubp\n" 18 "fld1\n" 19 "fadd %%st(2)\n" 20 "fmulp\n" /* 1 - x^2 */ 21 "fsqrt\n" /* sqrtl (1 - x^2) */ 22 "fabs\n" 23 "fxch %%st(1)\n" 24 "fpatan" 25 : "=t" (res) : "0" (x) : "st(1)"); 26 return res; 27 } 28 libm_alias_finite (__ieee754_acosl, __acosl) 29