Back to index

glibc  2.9
e_acosl.c
Go to the documentation of this file.
00001 /*
00002  * Written by J.T. Conklin <jtc@netbsd.org>.
00003  * Public domain.
00004  *
00005  * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
00006  */
00007 
00008 #include <math_private.h>
00009 
00010 long double
00011 __ieee754_acosl (long double x)
00012 {
00013   long double res;
00014 
00015   /* acosl = atanl (sqrtl(1 - x^2) / x) */
00016   asm (       "fld   %%st\n"
00017        "fmul  %%st(0)\n"           /* x^2 */
00018        "fld1\n"
00019        "fsubp\n"                   /* 1 - x^2 */
00020        "fsqrt\n"                   /* sqrtl (1 - x^2) */
00021        "fxch  %%st(1)\n"
00022        "fpatan"
00023        : "=t" (res) : "0" (x) : "st(1)");
00024   return res;
00025 }