Deleted Added
sdiff udiff text old ( 181062 ) new ( 181074 )
full compact
1
2/* @(#)e_acos.c 1.3 95/01/18 */
3/*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 *
7 * Developed at SunSoft, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
10 * is preserved.
11 * ====================================================
12 */
13
14#include <sys/cdefs.h>
15__FBSDID("$FreeBSD: head/lib/msun/src/e_acos.c 181062 2008-07-31 19:57:50Z das $");
16
17/* __ieee754_acos(x)
18 * Method :
19 * acos(x) = pi/2 - asin(x)
20 * acos(-x) = pi/2 + asin(x)
21 * For |x|<=0.5
22 * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
23 * For x>0.5

--- 9 unchanged lines hidden (view full) ---

33 *
34 * Special cases:
35 * if x is NaN, return x itself;
36 * if |x|>1, return NaN with invalid signal.
37 *
38 * Function needed: sqrt
39 */
40
41#include "math.h"
42#include "math_private.h"
43
44static const double
45one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
46pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
47pio2_hi = 1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */
48static volatile double

--- 49 unchanged lines hidden (view full) ---

98 c = (z-df*df)/(s+df);
99 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
100 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
101 r = p/q;
102 w = r*s+c;
103 return 2.0*(df+w);
104 }
105}