~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/math/__invtrigl.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "__invtrigl.h"
 
2
 
 
3
#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
 
4
 
 
5
static const long double
 
6
pS0 =  1.66666666666666666631e-01L,
 
7
pS1 = -4.16313987993683104320e-01L,
 
8
pS2 =  3.69068046323246813704e-01L,
 
9
pS3 = -1.36213932016738603108e-01L,
 
10
pS4 =  1.78324189708471965733e-02L,
 
11
pS5 = -2.19216428382605211588e-04L,
 
12
pS6 = -7.10526623669075243183e-06L,
 
13
qS1 = -2.94788392796209867269e+00L,
 
14
qS2 =  3.27309890266528636716e+00L,
 
15
qS3 = -1.68285799854822427013e+00L,
 
16
qS4 =  3.90699412641738801874e-01L,
 
17
qS5 = -3.14365703596053263322e-02L;
 
18
 
 
19
const long double pio2_hi = 1.57079632679489661926L;
 
20
const long double pio2_lo = -2.50827880633416601173e-20L;
 
21
 
 
22
/* used in asinl() and acosl() */
 
23
/* R(x^2) is a rational approximation of (asin(x)-x)/x^3 with Remez algorithm */
 
24
long double __invtrigl_R(long double z)
 
25
{
 
26
        long double p, q;
 
27
        p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*(pS5+z*pS6))))));
 
28
        q = 1.0+z*(qS1+z*(qS2+z*(qS3+z*(qS4+z*qS5))));
 
29
        return p/q;
 
30
}
 
31
#endif