Deleted Added
full compact
k_tan.c (97413) k_tan.c (108533)
1/* @(#)k_tan.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#ifndef lint
1/* @(#)k_tan.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#ifndef lint
14static char rcsid[] = "$FreeBSD: head/lib/msun/src/k_tan.c 97413 2002-05-28 18:15:04Z alfred $";
14static char rcsid[] = "$FreeBSD: head/lib/msun/src/k_tan.c 108533 2003-01-01 18:49:04Z schweikh $";
15#endif
16
17/* __kernel_tan( x, y, k )
18 * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
19 * Input x is assumed to be bounded by ~pi/4 in magnitude.
20 * Input y is the tail of x.
21 * Input k indicates whether tan (if k=1) or
22 * -1/tan (if k= -1) is returned.
23 *
24 * Algorithm
25 * 1. Since tan(-x) = -tan(x), we need only to consider positive x.
26 * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
15#endif
16
17/* __kernel_tan( x, y, k )
18 * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
19 * Input x is assumed to be bounded by ~pi/4 in magnitude.
20 * Input y is the tail of x.
21 * Input k indicates whether tan (if k=1) or
22 * -1/tan (if k= -1) is returned.
23 *
24 * Algorithm
25 * 1. Since tan(-x) = -tan(x), we need only to consider positive x.
26 * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
27 * 3. tan(x) is approximated by a odd polynomial of degree 27 on
27 * 3. tan(x) is approximated by an odd polynomial of degree 27 on
28 * [0,0.67434]
29 * 3 27
30 * tan(x) ~ x + T1*x + ... + T13*x
31 * where
32 *
33 * |tan(x) 2 4 26 | -59.2
34 * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2
35 * | x |

--- 88 unchanged lines hidden ---
28 * [0,0.67434]
29 * 3 27
30 * tan(x) ~ x + T1*x + ... + T13*x
31 * where
32 *
33 * |tan(x) 2 4 26 | -59.2
34 * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2
35 * | x |

--- 88 unchanged lines hidden ---