Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Written by J.T. Conklin <jtc@netbsd.org>.
  3.  * Public domain.
  4.  * Adapted for long double type by Danny Smith <dannysmith@users.sourceforge.net>.
  5.  */
  6.  
  7. /* asin = atan (x / sqrt(1 - x^2)) */
  8.  
  9. long double asinl (long double x)
  10. {
  11.   long double res;
  12.  
  13.   asm ( "fld    %%st\n\t"
  14.         "fmul   %%st(0)\n\t"                    /* x^2 */
  15.         "fld1\n\t"
  16.         "fsubp\n\t"                             /* 1 - x^2 */
  17.         "fsqrt\n\t"                             /* sqrt (1 - x^2) */
  18.         "fpatan"
  19.         : "=t" (res) : "0" (x) : "st(1)");
  20.   return res;
  21. }
  22.