2 * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
21 /* Algorithm and coefficients from:
22 "Software manual for the elementary functions"
23 by W.J. Cody and W. Waite, Prentice-Hall, 1980
27 -0.16666666666666665052e+0,
28 0.83333333333331650314e-2,
29 -0.19841269841201840457e-3,
30 0.27557319210152756119e-5,
31 -0.25052106798274584544e-7,
32 0.16058936490371589114e-9,
33 -0.76429178068910467734e-12,
34 0.27204790957888846175e-14
51 /* ??? avoid loss of significance, if y is too large, error ??? */
55 /* Use extended precision to calculate reduced argument.
56 Here we used 12 bits of the mantissa for a1.
57 Also split x in integer part x1 and fraction part x2.
59 #define A1 3.1416015625
60 #define A2 -8.908910206761537356617e-6
66 if (_fif(y
, 0.5, &x1
)) neg
= !neg
;
67 if (cos_flag
) y
-= 0.5;
68 x2
= _fif(x
, 1.0, &x1
);
81 /* ??? avoid underflow ??? */
84 x
+= x
* y
* POLYNOM7(y
, r
);