1996-03-05 21:41:30 +00:00
|
|
|
/*
|
2001-03-12 00:04:52 +00:00
|
|
|
* IBM Accurate Mathematical Library
|
2002-07-06 06:36:39 +00:00
|
|
|
* written by International Business Machines Corp.
|
2013-01-02 19:01:50 +00:00
|
|
|
* Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
1996-03-05 21:41:30 +00:00
|
|
|
*
|
2001-03-12 00:04:52 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
2002-08-26 22:40:48 +00:00
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2001-03-12 00:04:52 +00:00
|
|
|
* (at your option) any later version.
|
1996-03-05 21:41:30 +00:00
|
|
|
*
|
2001-03-12 00:04:52 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2002-08-20 21:51:55 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
1996-03-05 21:41:30 +00:00
|
|
|
*
|
2001-03-12 00:04:52 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
2012-02-09 23:18:22 +00:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
1996-03-05 21:41:30 +00:00
|
|
|
*/
|
2001-03-12 00:04:52 +00:00
|
|
|
/*********************************************************************/
|
|
|
|
/* MODULE_NAME: utan.c */
|
|
|
|
/* */
|
|
|
|
/* FUNCTIONS: utan */
|
|
|
|
/* tanMp */
|
|
|
|
/* */
|
|
|
|
/* FILES NEEDED:dla.h endian.h mpa.h mydefs.h utan.h */
|
|
|
|
/* branred.c sincos32.c mptan.c */
|
|
|
|
/* utan.tbl */
|
|
|
|
/* */
|
|
|
|
/* An ultimate tan routine. Given an IEEE double machine number x */
|
|
|
|
/* it computes the correctly rounded (to nearest) value of tan(x). */
|
|
|
|
/* Assumption: Machine arithmetic operations are performed in */
|
|
|
|
/* round to nearest mode of IEEE 754 standard. */
|
|
|
|
/* */
|
|
|
|
/*********************************************************************/
|
2009-04-26 05:42:49 +00:00
|
|
|
|
|
|
|
#include <errno.h>
|
2001-03-12 00:04:52 +00:00
|
|
|
#include "endian.h"
|
2011-10-23 16:50:28 +00:00
|
|
|
#include <dla.h>
|
2001-03-12 00:04:52 +00:00
|
|
|
#include "mpa.h"
|
|
|
|
#include "MathLib.h"
|
2012-03-09 19:29:16 +00:00
|
|
|
#include <math.h>
|
|
|
|
#include <math_private.h>
|
2012-03-02 20:51:39 +00:00
|
|
|
#include <fenv.h>
|
2013-10-11 17:07:53 +00:00
|
|
|
#include <stap-probe.h>
|
2001-05-12 20:15:01 +00:00
|
|
|
|
2011-10-25 04:56:33 +00:00
|
|
|
#ifndef SECTION
|
|
|
|
# define SECTION
|
|
|
|
#endif
|
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
static double tanMp (double);
|
|
|
|
void __mptan (double, mp_no *, int);
|
1996-03-05 21:41:30 +00:00
|
|
|
|
2011-10-25 04:56:33 +00:00
|
|
|
double
|
|
|
|
SECTION
|
2013-03-29 11:08:27 +00:00
|
|
|
tan (double x)
|
|
|
|
{
|
2001-03-12 00:04:52 +00:00
|
|
|
#include "utan.h"
|
|
|
|
#include "utan.tbl"
|
1996-03-05 21:41:30 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
int ux, i, n;
|
|
|
|
double a, da, a2, b, db, c, dc, c1, cc1, c2, cc2, c3, cc3, fi, ffi, gi, pz,
|
|
|
|
s, sy, t, t1, t2, t3, t4, t7, t8, t9, t10, w, x2, xn, xx2, y, ya, yya, z0,
|
|
|
|
z, zz, z2, zz2;
|
2011-10-24 18:21:18 +00:00
|
|
|
#ifndef DLA_FMS
|
2013-03-29 11:08:27 +00:00
|
|
|
double t5, t6;
|
2011-10-22 23:02:20 +00:00
|
|
|
#endif
|
2001-03-12 00:04:52 +00:00
|
|
|
int p;
|
2013-03-29 11:08:27 +00:00
|
|
|
number num, v;
|
|
|
|
mp_no mpa, mpt1, mpt2;
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2012-03-02 20:51:39 +00:00
|
|
|
double retval;
|
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
int __branred (double, double *, double *);
|
|
|
|
int __mpranred (double, mp_no *, int);
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2012-03-10 16:55:53 +00:00
|
|
|
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
|
2012-03-02 20:51:39 +00:00
|
|
|
|
2001-03-12 00:04:52 +00:00
|
|
|
/* x=+-INF, x=NaN */
|
2013-03-29 11:08:27 +00:00
|
|
|
num.d = x;
|
|
|
|
ux = num.i[HIGH_HALF];
|
|
|
|
if ((ux & 0x7ff00000) == 0x7ff00000)
|
|
|
|
{
|
|
|
|
if ((ux & 0x7fffffff) == 0x7ff00000)
|
|
|
|
__set_errno (EDOM);
|
|
|
|
retval = x - x;
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
w = (x < 0.0) ? -x : x;
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (I) The case abs(x) <= 1.259e-8 */
|
2013-03-29 11:08:27 +00:00
|
|
|
if (w <= g1.d)
|
|
|
|
{
|
|
|
|
retval = x;
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (II) The case 1.259e-8 < abs(x) <= 0.0608 */
|
2013-03-29 11:08:27 +00:00
|
|
|
if (w <= g2.d)
|
|
|
|
{
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
/* First stage */
|
|
|
|
x2 = x * x;
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
t2 = d9.d + x2 * d11.d;
|
|
|
|
t2 = d7.d + x2 * t2;
|
|
|
|
t2 = d5.d + x2 * t2;
|
|
|
|
t2 = d3.d + x2 * t2;
|
|
|
|
t2 *= x * x2;
|
|
|
|
|
|
|
|
if ((y = x + (t2 - u1.d * t2)) == x + (t2 + u1.d * t2))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* Second stage */
|
2013-03-29 11:08:27 +00:00
|
|
|
c1 = a25.d + x2 * a27.d;
|
|
|
|
c1 = a23.d + x2 * c1;
|
|
|
|
c1 = a21.d + x2 * c1;
|
|
|
|
c1 = a19.d + x2 * c1;
|
|
|
|
c1 = a17.d + x2 * c1;
|
|
|
|
c1 = a15.d + x2 * c1;
|
|
|
|
c1 *= x2;
|
|
|
|
|
|
|
|
EMULV (x, x, x2, xx2, t1, t2, t3, t4, t5);
|
|
|
|
ADD2 (a13.d, aa13.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a11.d, aa11.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a9.d, aa9.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a7.d, aa7.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a5.d, aa5.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (x, 0.0, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (x, 0.0, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
if ((y = c1 + (cc1 - u2.d * c1)) == c1 + (cc1 + u2.d * c1))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
2012-03-02 20:51:39 +00:00
|
|
|
goto ret;
|
2001-03-12 00:04:52 +00:00
|
|
|
}
|
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
/* (III) The case 0.0608 < abs(x) <= 0.787 */
|
|
|
|
if (w <= g3.d)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* First stage */
|
|
|
|
i = ((int) (mfftnhf.d + TWO8 * w));
|
|
|
|
z = w - xfg[i][0].d;
|
|
|
|
z2 = z * z;
|
2013-03-29 11:10:36 +00:00
|
|
|
s = (x < 0.0) ? -1 : 1;
|
2013-03-29 11:08:27 +00:00
|
|
|
pz = z + z * z2 * (e0.d + z2 * e1.d);
|
|
|
|
fi = xfg[i][1].d;
|
|
|
|
gi = xfg[i][2].d;
|
|
|
|
t2 = pz * (gi + fi) / (gi - pz);
|
|
|
|
if ((y = fi + (t2 - fi * u3.d)) == fi + (t2 + fi * u3.d))
|
|
|
|
{
|
|
|
|
retval = (s * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = fi * ua3.d + t3 * ub3.d;
|
|
|
|
if ((y = fi + (t2 - t4)) == fi + (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (s * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
/* Second stage */
|
|
|
|
ffi = xfg[i][3].d;
|
|
|
|
c1 = z2 * (a7.d + z2 * (a9.d + z2 * a11.d));
|
|
|
|
EMULV (z, z, z2, zz2, t1, t2, t3, t4, t5);
|
|
|
|
ADD2 (a5.d, aa5.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (z, 0.0, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (z, 0.0, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
ADD2 (fi, ffi, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (fi, ffi, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
SUB2 (1.0, 0.0, c3, cc3, c1, cc1, t1, t2);
|
|
|
|
DIV2 (c2, cc2, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
|
|
|
|
if ((y = c3 + (cc3 - u4.d * c3)) == c3 + (cc3 + u4.d * c3))
|
|
|
|
{
|
|
|
|
retval = (s * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
1996-03-05 21:41:30 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
/* (---) The case 0.787 < abs(x) <= 25 */
|
|
|
|
if (w <= g4.d)
|
|
|
|
{
|
|
|
|
/* Range reduction by algorithm i */
|
|
|
|
t = (x * hpinv.d + toint.d);
|
|
|
|
xn = t - toint.d;
|
|
|
|
v.d = t;
|
|
|
|
t1 = (x - xn * mp1.d) - xn * mp2.d;
|
|
|
|
n = v.i[LOW_HALF] & 0x00000001;
|
|
|
|
da = xn * mp3.d;
|
|
|
|
a = t1 - da;
|
|
|
|
da = (t1 - a) - da;
|
|
|
|
if (a < 0.0)
|
|
|
|
{
|
|
|
|
ya = -a;
|
|
|
|
yya = -da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = -1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ya = a;
|
|
|
|
yya = da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = 1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* (IV),(V) The case 0.787 < abs(x) <= 25, abs(y) <= 1e-7 */
|
|
|
|
if (ya <= gy1.d)
|
|
|
|
{
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (VI) The case 0.787 < abs(x) <= 25, 1e-7 < abs(y) <= 0.0608 */
|
|
|
|
if (ya <= gy2.d)
|
|
|
|
{
|
|
|
|
a2 = a * a;
|
|
|
|
t2 = d9.d + a2 * d11.d;
|
|
|
|
t2 = d7.d + a2 * t2;
|
|
|
|
t2 = d5.d + a2 * t2;
|
|
|
|
t2 = d3.d + a2 * t2;
|
|
|
|
t2 = da + a * a2 * t2;
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* First stage -cot */
|
|
|
|
EADD (a, t2, b, db);
|
|
|
|
DIV2 (1.0, 0.0, b, db, c, dc, t1, t2, t3, t4, t5, t6, t7, t8,
|
|
|
|
t9, t10);
|
|
|
|
if ((y = c + (dc - u6.d * c)) == c + (dc + u6.d * c))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* First stage tan */
|
|
|
|
if ((y = a + (t2 - u5.d * a)) == a + (t2 + u5.d * a))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Second stage */
|
|
|
|
/* Range reduction by algorithm ii */
|
|
|
|
t = (x * hpinv.d + toint.d);
|
|
|
|
xn = t - toint.d;
|
|
|
|
v.d = t;
|
|
|
|
t1 = (x - xn * mp1.d) - xn * mp2.d;
|
|
|
|
n = v.i[LOW_HALF] & 0x00000001;
|
|
|
|
da = xn * pp3.d;
|
|
|
|
t = t1 - da;
|
|
|
|
da = (t1 - t) - da;
|
|
|
|
t1 = xn * pp4.d;
|
|
|
|
a = t - t1;
|
|
|
|
da = ((t - a) - t1) + da;
|
|
|
|
|
|
|
|
/* Second stage */
|
|
|
|
EADD (a, da, t1, t2);
|
|
|
|
a = t1;
|
|
|
|
da = t2;
|
|
|
|
MUL2 (a, da, a, da, x2, xx2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
|
|
|
|
c1 = a25.d + x2 * a27.d;
|
|
|
|
c1 = a23.d + x2 * c1;
|
|
|
|
c1 = a21.d + x2 * c1;
|
|
|
|
c1 = a19.d + x2 * c1;
|
|
|
|
c1 = a17.d + x2 * c1;
|
|
|
|
c1 = a15.d + x2 * c1;
|
|
|
|
c1 *= x2;
|
|
|
|
|
|
|
|
ADD2 (a13.d, aa13.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a11.d, aa11.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a9.d, aa9.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a7.d, aa7.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a5.d, aa5.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (a, da, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a, da, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* Second stage -cot */
|
|
|
|
DIV2 (1.0, 0.0, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7,
|
|
|
|
t8, t9, t10);
|
|
|
|
if ((y = c2 + (cc2 - u8.d * c2)) == c2 + (cc2 + u8.d * c2))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Second stage tan */
|
|
|
|
if ((y = c1 + (cc1 - u7.d * c1)) == c1 + (cc1 + u7.d * c1))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (VII) The case 0.787 < abs(x) <= 25, 0.0608 < abs(y) <= 0.787 */
|
|
|
|
|
|
|
|
/* First stage */
|
|
|
|
i = ((int) (mfftnhf.d + TWO8 * ya));
|
|
|
|
z = (z0 = (ya - xfg[i][0].d)) + yya;
|
|
|
|
z2 = z * z;
|
|
|
|
pz = z + z * z2 * (e0.d + z2 * e1.d);
|
|
|
|
fi = xfg[i][1].d;
|
|
|
|
gi = xfg[i][2].d;
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
t2 = pz * (fi + gi) / (fi + pz);
|
|
|
|
if ((y = gi - (t2 - gi * u10.d)) == gi - (t2 + gi * u10.d))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = gi * ua10.d + t3 * ub10.d;
|
|
|
|
if ((y = gi - (t2 - t4)) == gi - (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
t2 = pz * (gi + fi) / (gi - pz);
|
|
|
|
if ((y = fi + (t2 - fi * u9.d)) == fi + (t2 + fi * u9.d))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = fi * ua9.d + t3 * ub9.d;
|
|
|
|
if ((y = fi + (t2 - t4)) == fi + (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
/* Second stage */
|
|
|
|
ffi = xfg[i][3].d;
|
|
|
|
EADD (z0, yya, z, zz)
|
|
|
|
MUL2 (z, zz, z, zz, z2, zz2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
c1 = z2 * (a7.d + z2 * (a9.d + z2 * a11.d));
|
|
|
|
ADD2 (a5.d, aa5.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (z, zz, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (z, zz, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
ADD2 (fi, ffi, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (fi, ffi, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
SUB2 (1.0, 0.0, c3, cc3, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
DIV2 (c1, cc1, c2, cc2, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u12.d * c3)) == c3 + (cc3 + u12.d * c3))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
DIV2 (c2, cc2, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u11.d * c3)) == c3 + (cc3 + u11.d * c3))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (---) The case 25 < abs(x) <= 1e8 */
|
2013-03-29 11:08:27 +00:00
|
|
|
if (w <= g5.d)
|
|
|
|
{
|
|
|
|
/* Range reduction by algorithm ii */
|
|
|
|
t = (x * hpinv.d + toint.d);
|
|
|
|
xn = t - toint.d;
|
|
|
|
v.d = t;
|
|
|
|
t1 = (x - xn * mp1.d) - xn * mp2.d;
|
|
|
|
n = v.i[LOW_HALF] & 0x00000001;
|
|
|
|
da = xn * pp3.d;
|
|
|
|
t = t1 - da;
|
|
|
|
da = (t1 - t) - da;
|
|
|
|
t1 = xn * pp4.d;
|
|
|
|
a = t - t1;
|
|
|
|
da = ((t - a) - t1) + da;
|
|
|
|
EADD (a, da, t1, t2);
|
|
|
|
a = t1;
|
|
|
|
da = t2;
|
|
|
|
if (a < 0.0)
|
|
|
|
{
|
|
|
|
ya = -a;
|
|
|
|
yya = -da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = -1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ya = a;
|
|
|
|
yya = da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = 1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* (+++) The case 25 < abs(x) <= 1e8, abs(y) <= 1e-7 */
|
|
|
|
if (ya <= gy1.d)
|
|
|
|
{
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (VIII) The case 25 < abs(x) <= 1e8, 1e-7 < abs(y) <= 0.0608 */
|
|
|
|
if (ya <= gy2.d)
|
|
|
|
{
|
|
|
|
a2 = a * a;
|
|
|
|
t2 = d9.d + a2 * d11.d;
|
|
|
|
t2 = d7.d + a2 * t2;
|
|
|
|
t2 = d5.d + a2 * t2;
|
|
|
|
t2 = d3.d + a2 * t2;
|
|
|
|
t2 = da + a * a2 * t2;
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* First stage -cot */
|
|
|
|
EADD (a, t2, b, db);
|
|
|
|
DIV2 (1.0, 0.0, b, db, c, dc, t1, t2, t3, t4, t5, t6, t7, t8,
|
|
|
|
t9, t10);
|
|
|
|
if ((y = c + (dc - u14.d * c)) == c + (dc + u14.d * c))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* First stage tan */
|
|
|
|
if ((y = a + (t2 - u13.d * a)) == a + (t2 + u13.d * a))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Second stage */
|
|
|
|
MUL2 (a, da, a, da, x2, xx2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
c1 = a25.d + x2 * a27.d;
|
|
|
|
c1 = a23.d + x2 * c1;
|
|
|
|
c1 = a21.d + x2 * c1;
|
|
|
|
c1 = a19.d + x2 * c1;
|
|
|
|
c1 = a17.d + x2 * c1;
|
|
|
|
c1 = a15.d + x2 * c1;
|
|
|
|
c1 *= x2;
|
|
|
|
|
|
|
|
ADD2 (a13.d, aa13.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a11.d, aa11.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a9.d, aa9.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a7.d, aa7.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a5.d, aa5.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (a, da, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a, da, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* Second stage -cot */
|
|
|
|
DIV2 (1.0, 0.0, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7,
|
|
|
|
t8, t9, t10);
|
|
|
|
if ((y = c2 + (cc2 - u16.d * c2)) == c2 + (cc2 + u16.d * c2))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Second stage tan */
|
|
|
|
if ((y = c1 + (cc1 - u15.d * c1)) == c1 + (cc1 + u15.d * c1))
|
|
|
|
{
|
|
|
|
retval = (y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (IX) The case 25 < abs(x) <= 1e8, 0.0608 < abs(y) <= 0.787 */
|
|
|
|
/* First stage */
|
|
|
|
i = ((int) (mfftnhf.d + TWO8 * ya));
|
|
|
|
z = (z0 = (ya - xfg[i][0].d)) + yya;
|
|
|
|
z2 = z * z;
|
|
|
|
pz = z + z * z2 * (e0.d + z2 * e1.d);
|
|
|
|
fi = xfg[i][1].d;
|
|
|
|
gi = xfg[i][2].d;
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
t2 = pz * (fi + gi) / (fi + pz);
|
|
|
|
if ((y = gi - (t2 - gi * u18.d)) == gi - (t2 + gi * u18.d))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = gi * ua18.d + t3 * ub18.d;
|
|
|
|
if ((y = gi - (t2 - t4)) == gi - (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
t2 = pz * (gi + fi) / (gi - pz);
|
|
|
|
if ((y = fi + (t2 - fi * u17.d)) == fi + (t2 + fi * u17.d))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = fi * ua17.d + t3 * ub17.d;
|
|
|
|
if ((y = fi + (t2 - t4)) == fi + (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* Second stage */
|
2013-03-29 11:08:27 +00:00
|
|
|
ffi = xfg[i][3].d;
|
|
|
|
EADD (z0, yya, z, zz);
|
|
|
|
MUL2 (z, zz, z, zz, z2, zz2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
c1 = z2 * (a7.d + z2 * (a9.d + z2 * a11.d));
|
|
|
|
ADD2 (a5.d, aa5.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (z, zz, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (z, zz, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
ADD2 (fi, ffi, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (fi, ffi, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
SUB2 (1.0, 0.0, c3, cc3, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
DIV2 (c1, cc1, c2, cc2, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u20.d * c3)) == c3 + (cc3 + u20.d * c3))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
DIV2 (c2, cc2, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u19.d * c3)) == c3 + (cc3 + u19.d * c3))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
2012-03-02 20:51:39 +00:00
|
|
|
goto ret;
|
2001-03-12 00:04:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* (---) The case 1e8 < abs(x) < 2**1024 */
|
|
|
|
/* Range reduction by algorithm iii */
|
2013-03-29 11:08:27 +00:00
|
|
|
n = (__branred (x, &a, &da)) & 0x00000001;
|
|
|
|
EADD (a, da, t1, t2);
|
|
|
|
a = t1;
|
|
|
|
da = t2;
|
|
|
|
if (a < 0.0)
|
|
|
|
{
|
|
|
|
ya = -a;
|
|
|
|
yya = -da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = -1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ya = a;
|
|
|
|
yya = da;
|
2013-03-29 11:10:36 +00:00
|
|
|
sy = 1;
|
2013-03-29 11:08:27 +00:00
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (+++) The case 1e8 < abs(x) < 2**1024, abs(y) <= 1e-7 */
|
2013-03-29 11:08:27 +00:00
|
|
|
if (ya <= gy1.d)
|
|
|
|
{
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (X) The case 1e8 < abs(x) < 2**1024, 1e-7 < abs(y) <= 0.0608 */
|
2013-03-29 11:08:27 +00:00
|
|
|
if (ya <= gy2.d)
|
|
|
|
{
|
|
|
|
a2 = a * a;
|
|
|
|
t2 = d9.d + a2 * d11.d;
|
|
|
|
t2 = d7.d + a2 * t2;
|
|
|
|
t2 = d5.d + a2 * t2;
|
|
|
|
t2 = d3.d + a2 * t2;
|
|
|
|
t2 = da + a * a2 * t2;
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* First stage -cot */
|
|
|
|
EADD (a, t2, b, db);
|
|
|
|
DIV2 (1.0, 0.0, b, db, c, dc, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c + (dc - u22.d * c)) == c + (dc + u22.d * c))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* First stage tan */
|
|
|
|
if ((y = a + (t2 - u21.d * a)) == a + (t2 + u21.d * a))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Second stage */
|
|
|
|
/* Reduction by algorithm iv */
|
|
|
|
p = 10;
|
|
|
|
n = (__mpranred (x, &mpa, p)) & 0x00000001;
|
|
|
|
__mp_dbl (&mpa, &a, p);
|
|
|
|
__dbl_mp (a, &mpt1, p);
|
|
|
|
__sub (&mpa, &mpt1, &mpt2, p);
|
|
|
|
__mp_dbl (&mpt2, &da, p);
|
|
|
|
|
|
|
|
MUL2 (a, da, a, da, x2, xx2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
|
|
|
|
c1 = a25.d + x2 * a27.d;
|
|
|
|
c1 = a23.d + x2 * c1;
|
|
|
|
c1 = a21.d + x2 * c1;
|
|
|
|
c1 = a19.d + x2 * c1;
|
|
|
|
c1 = a17.d + x2 * c1;
|
|
|
|
c1 = a15.d + x2 * c1;
|
|
|
|
c1 *= x2;
|
|
|
|
|
|
|
|
ADD2 (a13.d, aa13.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a11.d, aa11.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a9.d, aa9.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a7.d, aa7.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a5.d, aa5.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (x2, xx2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (a, da, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a, da, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* Second stage -cot */
|
|
|
|
DIV2 (1.0, 0.0, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8,
|
|
|
|
t9, t10);
|
|
|
|
if ((y = c2 + (cc2 - u24.d * c2)) == c2 + (cc2 + u24.d * c2))
|
|
|
|
{
|
|
|
|
retval = (-y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Second stage tan */
|
|
|
|
if ((y = c1 + (cc1 - u23.d * c1)) == c1 + (cc1 + u23.d * c1))
|
|
|
|
{
|
|
|
|
retval = y;
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
|
|
|
goto ret;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* (XI) The case 1e8 < abs(x) < 2**1024, 0.0608 < abs(y) <= 0.787 */
|
|
|
|
/* First stage */
|
2013-03-29 11:08:27 +00:00
|
|
|
i = ((int) (mfftnhf.d + TWO8 * ya));
|
|
|
|
z = (z0 = (ya - xfg[i][0].d)) + yya;
|
|
|
|
z2 = z * z;
|
|
|
|
pz = z + z * z2 * (e0.d + z2 * e1.d);
|
|
|
|
fi = xfg[i][1].d;
|
|
|
|
gi = xfg[i][2].d;
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
t2 = pz * (fi + gi) / (fi + pz);
|
|
|
|
if ((y = gi - (t2 - gi * u26.d)) == gi - (t2 + gi * u26.d))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = gi * ua26.d + t3 * ub26.d;
|
|
|
|
if ((y = gi - (t2 - t4)) == gi - (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
t2 = pz * (gi + fi) / (gi - pz);
|
|
|
|
if ((y = fi + (t2 - fi * u25.d)) == fi + (t2 + fi * u25.d))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
t3 = (t2 < 0.0) ? -t2 : t2;
|
|
|
|
t4 = fi * ua25.d + t3 * ub25.d;
|
|
|
|
if ((y = fi + (t2 - t4)) == fi + (t2 + t4))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* Second stage */
|
|
|
|
ffi = xfg[i][3].d;
|
2013-03-29 11:08:27 +00:00
|
|
|
EADD (z0, yya, z, zz);
|
|
|
|
MUL2 (z, zz, z, zz, z2, zz2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
c1 = z2 * (a7.d + z2 * (a9.d + z2 * a11.d));
|
|
|
|
ADD2 (a5.d, aa5.d, c1, 0.0, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (a3.d, aa3.d, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (z2, zz2, c2, cc2, c1, cc1, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
MUL2 (z, zz, c1, cc1, c2, cc2, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
ADD2 (z, zz, c2, cc2, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
ADD2 (fi, ffi, c1, cc1, c2, cc2, t1, t2);
|
|
|
|
MUL2 (fi, ffi, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
SUB2 (1.0, 0.0, c3, cc3, c1, cc1, t1, t2);
|
|
|
|
|
|
|
|
if (n)
|
|
|
|
{
|
|
|
|
/* -cot */
|
|
|
|
DIV2 (c1, cc1, c2, cc2, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u28.d * c3)) == c3 + (cc3 + u28.d * c3))
|
|
|
|
{
|
|
|
|
retval = (-sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tan */
|
|
|
|
DIV2 (c2, cc2, c1, cc1, c3, cc3, t1, t2, t3, t4, t5, t6, t7, t8, t9,
|
|
|
|
t10);
|
|
|
|
if ((y = c3 + (cc3 - u27.d * c3)) == c3 + (cc3 + u27.d * c3))
|
|
|
|
{
|
|
|
|
retval = (sy * y);
|
|
|
|
goto ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = tanMp (x);
|
2012-03-02 20:51:39 +00:00
|
|
|
goto ret;
|
2001-03-12 00:04:52 +00:00
|
|
|
|
2013-03-29 11:08:27 +00:00
|
|
|
ret:
|
2012-03-02 20:51:39 +00:00
|
|
|
return retval;
|
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
|
|
|
/* multiple precision stage */
|
|
|
|
/* Convert x to multi precision number,compute tan(x) by mptan() routine */
|
|
|
|
/* and converts result back to double */
|
2011-10-25 04:56:33 +00:00
|
|
|
static double
|
|
|
|
SECTION
|
2013-03-29 11:08:27 +00:00
|
|
|
tanMp (double x)
|
2001-03-12 00:04:52 +00:00
|
|
|
{
|
|
|
|
int p;
|
|
|
|
double y;
|
|
|
|
mp_no mpy;
|
2013-03-29 11:08:27 +00:00
|
|
|
p = 32;
|
|
|
|
__mptan (x, &mpy, p);
|
|
|
|
__mp_dbl (&mpy, &y, p);
|
2013-10-11 17:07:53 +00:00
|
|
|
LIBC_PROBE (slowtan, 2, &x, &y);
|
2001-03-12 00:04:52 +00:00
|
|
|
return y;
|
1996-03-05 21:41:30 +00:00
|
|
|
}
|
2001-03-12 00:04:52 +00:00
|
|
|
|
update from main archive 961005
Sun Oct 6 02:05:52 1996 Ulrich Drepper <drepper@cygnus.com>
* posix/getopt.c: Add casts to prevent warnings.
* posix/regex.c: Likewise.
* math/Makefile (long-m-routines, long-m-yes): Define to correct
values to make `long double' functions available.
(distribute): Add $(long-m-yes:=.c).
* sysdeps/libm-i387/s_ceill.S: Correct loading of return value.
Use long double instruction.
* sysdeps/libm-ieee754/e_atanhl.c (huge): Correct constant.
* sysdeps/libm-ieee754/e_asinhl.c: Likewise.
* sysdeps/libm-ieee754/s_tanhl.c: Likewise.
* sysdeps/libm-ieee754/e_coshl.c: New file.
* sysdeps/libm-ieee754/s_asinh.c [!NO_LONG_DOUBLE]: Define names
for `long double' version as alias.
* sysdeps/libm-ieee754/s_atan.c: Likewise.
* sysdeps/libm-ieee754/s_cbrt.c: Likewise.
* sysdeps/libm-ieee754/s_ceil.c: Likewise.
* sysdeps/libm-ieee754/s_copysign.c: Likewise.
* sysdeps/libm-ieee754/s_cos.c: Likewise.
* sysdeps/libm-ieee754/s_erf.c: Likewise.
* sysdeps/libm-ieee754/s_expm1.c: Likewise.
* sysdeps/libm-ieee754/s_fabs.c: Likewise.
* sysdeps/libm-ieee754/s_finite.c: Likewise.
* sysdeps/libm-ieee754/s_floor.c: Likewise.
* sysdeps/libm-ieee754/s_frexp.c: Likewise.
* sysdeps/libm-ieee754/s_ilogb.c: Likewise.
* sysdeps/libm-ieee754/s_ldexp.c: Likewise.
* sysdeps/libm-ieee754/s_log1p.c: Likewise.
* sysdeps/libm-ieee754/s_logb.c: Likewise.
* sysdeps/libm-ieee754/s_modf.c: Likewise.
* sysdeps/libm-ieee754/s_nextafter.c: Likewise.
* sysdeps/libm-ieee754/s_rint.c: Likewise.
* sysdeps/libm-ieee754/s_scalbn.c: Likewise.
* sysdeps/libm-ieee754/s_significand.c: Likewise.
* sysdeps/libm-ieee754/s_sin.c: Likewise.
* sysdeps/libm-ieee754/s_tan.c: Likewise.
* sysdeps/libm-ieee754/s_tanh.c: Likewise.
* sysdeps/libm-ieee754/w_acos.c: Likewise.
* sysdeps/libm-ieee754/w_acosh.c: Likewise.
* sysdeps/libm-ieee754/w_sin.c: Likewise.
* sysdeps/libm-ieee754/w_atan2.c: Likewise.
* sysdeps/libm-ieee754/w_atanh.c: Likewise.
* sysdeps/libm-ieee754/w_cabs.c: Likewise.
* sysdeps/libm-ieee754/w_cosh.c: Likewise.
* sysdeps/libm-ieee754/w_drem.c: Likewise.
* sysdeps/libm-ieee754/w_exp.c: Likewise.
* sysdeps/libm-ieee754/w_fmod.c: Likewise.
* sysdeps/libm-ieee754/w_gamma.c: Likewise.
* sysdeps/libm-ieee754/w_gamma_r.c: Likewise.
* sysdeps/libm-ieee754/w_hypot.c: Likewise.
* sysdeps/libm-ieee754/w_j0.c: Likewise.
* sysdeps/libm-ieee754/w_j1.c: Likewise.
* sysdeps/libm-ieee754/w_jn.c: Likewise.
* sysdeps/libm-ieee754/w_lgamma.c: Likewise.
* sysdeps/libm-ieee754/w_lgamma_r.c: Likewise.
* sysdeps/libm-ieee754/w_log.c: Likewise.
* sysdeps/libm-ieee754/w_log10.c: Likewise.
* sysdeps/libm-ieee754/w_pow.c: Likewise.
* sysdeps/libm-ieee754/w_remainder.c: Likewise.
* sysdeps/libm-ieee754/w_scalb.c: Likewise.
* sysdeps/libm-ieee754/w_sinh.c: Likewise.
* sysdeps/libm-ieee754/w_sqrt.c: Likewise.
Stub files for missing long double math functions.
* sysdeps/stub/e_acoshl.c: New file.
* sysdeps/stub/e_hypotl.c: New file.
* sysdeps/stub/e_j0l.c: New file.
* sysdeps/stub/e_j1l.c: New file.
* sysdeps/stub/e_jnl.c: New file.
* sysdeps/stub/e_lgammal_r.c: New file.
* sysdeps/stub/e_powl.c: New file.
* sysdeps/stub/e_rem_pio2l.c: New file.
* sysdeps/stub/e_sinhl.c: New file.
* sysdeps/stub/k_cosl.c: New file.
* sysdeps/stub/k_rem_pio2l.c: New file.
* sysdeps/stub/k_sinl.c: New file.
* sysdeps/stub/k_tanl.c: New file.
* sysdeps/stub/s_erfl.c: New file.
* sysdeps/stub/s_expm1l.c: New file.
* sysdeps/i386/__longjmp.S: Use PSEUDO_END macro to provide
.size directive.
* sysdeps/i386/bsd-_setjmp.S: Likewise.
* sysdeps/i386/bsd-setjmp.S: Likewise.
* sysdeps/i386/memchr.S: Likewise.
* sysdeps/i386/memcmp.S: Likewise.
* sysdeps/i386/setjmp.S: Likewise.
* sysdeps/i386/stpcpy.S: Likewise.
* sysdeps/i386/stpncpy.S: Likewise.
* sysdeps/i386/strchr.S: Likewise.
* sysdeps/i386/strcspn.S: Likewise.
* sysdeps/i386/strpbrk.S: Likewise.
* sysdeps/i386/strrchr.S: Likewise.
* sysdeps/i386/strspn.S: Likewise.
* sysdeps/i386/strtok.S: Likewise.
* sysdeps/i386/i486/strcat.S: Likewise.
* sysdeps/i386/i486/strlen.S: Likewise.
* sysdeps/i386/i586/memset.S: Likewise.
* sysdeps/i386/i586/strchr.S: Likewise.
* sysdeps/i386/i586/strlen.S: Likewise.
* sysdeps/libm-i387/e_acos.S: Likewise.
* sysdeps/libm-i387/e_acosl.S: Likewise.
* sysdeps/libm-i387/e_asin.S: Likewise.
* sysdeps/libm-i387/e_asinl.S: Likewise.
* sysdeps/libm-i387/e_atan2.S: Likewise.
* sysdeps/libm-i387/e_atan2l.S: Likewise.
* sysdeps/libm-i387/e_exp.S: Likewise.
* sysdeps/libm-i387/e_expl.S: Likewise.
* sysdeps/libm-i387/e_fmod.S: Likewise.
* sysdeps/libm-i387/e_fmodl.S: Likewise.
* sysdeps/libm-i387/e_log.S: Likewise.
* sysdeps/libm-i387/e_log10.S: Likewise.
* sysdeps/libm-i387/e_log10l.S: Likewise.
* sysdeps/libm-i387/e_logl.S: Likewise.
* sysdeps/libm-i387/e_remainder.S: Likewise.
* sysdeps/libm-i387/e_remainderf.S: Likewise.
* sysdeps/libm-i387/e_remainderl.S: Likewise.
* sysdeps/libm-i387/e_scalb.S: Likewise.
* sysdeps/libm-i387/e_scalbl.S: Likewise.
* sysdeps/libm-i387/e_sqrt.S: Likewise.
* sysdeps/libm-i387/e_sqrtf.S: Likewise.
* sysdeps/libm-i387/e_sqrtl.S: Likewise.
* sysdeps/libm-i387/s_atan.S: Likewise.
* sysdeps/libm-i387/s_atanf.S: Likewise.
* sysdeps/libm-i387/s_atanl.S: Likewise.
* sysdeps/libm-i387/s_ceil.S: Likewise.
* sysdeps/libm-i387/s_ceilf.S: Likewise.
* sysdeps/libm-i387/s_ceill.S: Likewise.
* sysdeps/libm-i387/s_copysign.S: Likewise.
* sysdeps/libm-i387/s_copysignf.S: Likewise.
* sysdeps/libm-i387/s_copysignl.S: Likewise.
* sysdeps/libm-i387/s_cos.S: Likewise.
* sysdeps/libm-i387/s_cosf.S: Likewise.
* sysdeps/libm-i387/s_cosl.S: Likewise.
* sysdeps/libm-i387/s_finite.S: Likewise.
* sysdeps/libm-i387/s_finitef.S: Likewise.
* sysdeps/libm-i387/s_finitel.S: Likewise.
* sysdeps/libm-i387/s_floor.S: Likewise.
* sysdeps/libm-i387/s_floorf.S: Likewise.
* sysdeps/libm-i387/s_floorl.S: Likewise.
* sysdeps/libm-i387/s_ilogb.S: Likewise.
* sysdeps/libm-i387/s_ilogbf.S: Likewise.
* sysdeps/libm-i387/s_ilogbl.S: Likewise.
* sysdeps/libm-i387/s_log1p.S: Likewise.
* sysdeps/libm-i387/s_log1pf.S: Likewise.
* sysdeps/libm-i387/s_log1pl.S: Likewise.
* sysdeps/libm-i387/s_logb.S: Likewise.
* sysdeps/libm-i387/s_logbf.S: Likewise.
* sysdeps/libm-i387/s_logbl.S: Likewise.
* sysdeps/libm-i387/s_rint.S: Likewise.
* sysdeps/libm-i387/s_rintf.S: Likewise.
* sysdeps/libm-i387/s_rintl.S: Likewise.
* sysdeps/libm-i387/s_scalbn.S: Likewise.
* sysdeps/libm-i387/s_scalbnf.S: Likewise.
* sysdeps/libm-i387/s_scalbnl.S: Likewise.
* sysdeps/libm-i387/s_significand.S: Likewise.
* sysdeps/libm-i387/s_significandf.S: Likewise.
* sysdeps/libm-i387/s_significandl.S: Likewise.
* sysdeps/libm-i387/s_sin.S: Likewise.
* sysdeps/libm-i387/s_sinf.S: Likewise.
* sysdeps/libm-i387/s_sinl.S: Likewise.
* sysdeps/libm-i387/s_tan.S: Likewise.
* sysdeps/libm-i387/s_tanf.S: Likewise.
* sysdeps/libm-i387/s_tanl.S: Likewise.
* sysdeps/unix/sysv/linux/i386/clone.S: Add .size directive.
* sysdeps/unix/sysv/linux/i386/mmap.S. Likewise.
* sysdeps/unix/sysv/linux/i386/socket.S. Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.S. More compact .size line.
* sysdeps/i386/sysdep.h (ASM_SIZE_DIRECTIVE): New macro. Used
to provide .size directive on ELF systems.
* sysdeps/unix/sysv/linux/i386/profil-counter.h: Include
<sigcontext.h> and rename parameter type to sigcontext.
* sysdeps/unix/sysv/linux/i386/sigcontext.h New file.
* sysdeps/unix/sysv/linux/i386/syscall.S: From Linux 2.1 on
negative values might occur as positive results. Test against
-125 to decide for error or not.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise for system calls.
Thu Oct 3 21:07:58 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dl-open.c: Use _DYNAMIC instead of _dl_start to decide
whether this is a statically linked program. The latter is now
always defined.
Fri Oct 4 02:08:10 1996 Bang Jun-Young <bangjy@nownuri.nowcom.co.kr>
* po/ko.po: Update.
Fri Oct 4 02:07:46 1996 Michel Robitaille <robitail@IRO.UMontreal.CA>
* po/fr.po: New file.
Fri Oct 4 05:04:52 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/sigcontext.h: New file.
Add support for MD5 crypt replacement.
* Makefile (subdirs): Add crypt.
* shlib-versions: Add entry for libcrypt.
* crypt/md5-crypt.c: New file.
* crypt/md5.c: New file.
* crypt/md5.h: New file.
* sysdeps/generic/crypt-entry.c: New file.
* sysdeps/generic/crypt.h: New file.
Thu Oct 3 20:53:23 1996 Andreas Jaeger <aj@arthur.pfalz.de>
* dirent/tst-seekdir.c: Provide correct prototypes.
* io/test-utime.c: Likewise.
* malloc/mallocbug.c: Likewise.
* posix/testfnm.c: Likewise.
* stdio-common/xbug.c: Likewise.
* sysdeps/posix/cuserid.c: Likewise.
Wed Oct 2 13:33:48 1996 Richard Henderson <rth@tamu.edu>
Provide optimized string functions for Alpha processors.
* sysdeps/alpha/bzero.S: New file.
* sysdeps/alpha/memset.S: New file.
* sysdeps/alpha/stpcpy.S: New file.
* sysdeps/alpha/stpncpy.S: New file.
* sysdeps/alpha/strcat.S: New file.
* sysdeps/alpha/strchr.S: New file.
* sysdeps/alpha/strcpy.S: New file.
* sysdeps/alpha/strncat.S: New file.
* sysdeps/alpha/strncpy.S: New file.
* sysdeps/alpha/strrchr.S: New file.
* sysdeps/alpha/stxcpy.S: New file.
* sysdeps/alpha/stxncpy.S: New file.
* sysdeps/alpha/Makefile [$(sudir)==string]: Add stxcpy and
stxncpy to sysdep_routines.
Minor correction.
Wed Oct 2 13:41:48 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/strtok.c: Don't set stored pointer to NULL when
notheing is found. This guarantees all subsequent calls behave
the same.
* sysdeps/generic/strtok_r.c: Likewise.
Mon Sep 30 22:27:36 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/tempname.c (__stdio_gen_tempname): Don't declare
`i' as const.
Mon Sep 30 22:38:29 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/generic/strtok.c: When we hit EOS, don't set olds to
NULL immediately; we're going to get called one more time.
* sysdeps/generic/strtok_r.c: Likewise.
Tue Oct 1 09:12:21 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/ld-time.c: Always write some bytes at the end of
the file even if no `era's are specified.
* stdio-common/tmpname.c (tmpbuf): Don't define as array of
pointers.
Tue Oct 1 01:43:11 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/iofclose.c: Move unlocking to right position.
Mon Sep 30 03:08:34 1996 Richard Henderson <rth@tamu.edu>
* misc/Makefile: Kill force-wrapper.
* misc/force-wrapper.c: Delete.
* elf/eval.c: Add <string.h>.
* gmon/sys/gmon_out.h: Nonsense like `char foo[sizeof(char*)]'
followed by `bcopy(&ptr, &foo, sizeof(foo))' helps portability
and binary compatibility not at all. Better to do `char *foo'
followed by `foo = ptr' as it is much cleaner.
(struct gmon_hdr): Fix version.
(struct gmon_hist_hdr): Fix low_pc, high_pc, hist_size, prof_rate.
(struct gmon_cg_arc_record): Fix from_pc, self_pc, count.
* gmon/gmon.c: De-ansidecl-ify.
(write_hist): De-bcopy-fy.
(write_call_graph): Likewise.
* gmon/mcount.c: Assume _MCOUNT_DECL does the entire declaration.
* sysdeps/alpha/machine-gmon.h: Update _MCOUNT_DECL.
* sysdeps/generic/machine-gmon.h: Likewise.
* resolv/netdb.h: Add __set_h_errno to mimic __set_errno.
* nss/getXXent_r.c: Use __set_h_errno to set h_errno in all funcs.
* nss/nss_dns/dns-network.c: Likewise.
* resolv/getunamaddr.c: Likewise. Also use __set_errno where needed.
* resolv/getnetnamadr.c: Likewise.
* resolv/res_debug.c: Likewise.
* resolv/res_mkquery.c: Likewise.
* resolv/res_query.c: Likewise.
* libio/clearerr_u.c: It's not necessary to define __ protected
function so don't do it.
* libio/feof_u.c, libio/ferror_u.c, libio/fputc_u.c,
libio/getc_u.c, libio/getchar_u.c, libio/iofflush_u.c: Likewise.
* libio/fgetc.c: Avoid a warning by casting _IO_funlockfile for
the cleanup registrar.
* libio/fputc.c, libio/freopen.c, libio/fseek.c, libio/getc.c,
libio/getchar.c, libio/iofclose.c, libio/iofflush.c,
libio/iofgetpos.c, libio/iofgets.c, libio/iofputs.c,
libio/iofread.c, libio/iofsetpos.c, libio/ioftell.c,
libio/iofwrite.c, libio/iogetdelim.c, libio/iogets.c,
libio/ioputs.c, libio/iosetbuffer.c, libio/iosetvbuf.c,
libio/ioungetc.c, libio/putc.c, libio/putchar.c, libio/rewind.c:
Likewise.
* locale/programs/ld-ctype.c: Include <alloca.h>.
* login/login_tty.c: Get login_tty prototype from <utmp.h>.
* posix/sys/types.h: Change #defines to typedefs. This is looking
forward to more comprehensive namespace cleanups for C++.
* posix/unistd.h: Likewise for ssize_t.
* pwd/getpw.c: Prototype and rename getpw -> __getpw and add a
weak alias.
* resolv/base64.c: Don't do `for (NULL; ...)' as it causes
`statement with no effect' warnings.
* resolv/inet_neta.c: Include <string.h> for strlen.
* stdio-common/getline.c: Undef ssize_t before libio redefinition.
* stdio-common/tstgetln.c: Same. De-ansidecl-ify.
* stdio-common/vfprintf.c: Same for va_list.
* stdio-common/vfscanf.c: Same.
* stdio-common/reg-printf.c: Prototype the __ function.
* stdio-common/scanf.c [USE_IN_LIBIO]: Include <libioP.h> for
_IO_vscanf declaration.
* string/tester.c: Tsk, tsk. Don't cast pointers to int,
but to unsigned long for the health of 64-bit systems.
* sunrpc/svc_udp.c: Define MAX only if we don't have it yet.
Many system's <sys/param.h> pulls this in.
* sysdeps/generic/dl-cache.c: Kill the bottom half of the
patch doubled file.
* sysdeps/generic/pty.c (forkpty): Get login_tty decl from <utmp.h>
instead of defining it locally.
* sysdeps/posix/sigvec.c: Prototype wrapper_handler and convert_mask.
* sysdeps/stub/chflags.c: Prototype chflags.
* sysdeps/stub/fchflags.c: Prototype fchflags.
* sysdeps/stub/sstk.c: Prototype sstk.
* sysdeps/unix/alpha/sysdep.S: Add strong alias from errno
variable to __errno. Update __syscall_error to store to both
the global and per-thread variables.
* sysdeps/unix/sysv/linux/init-first.c: Change include of
init-first.h from "" to <> as "" does not search the include path.
Prototype _dl_start.
Sun Sep 29 14:41:17 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/Makefile ($(common-objpfx)s-proto.d): Make it a
pattern rule to get the right stem.
Sat Sep 28 01:30:06 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(objpfx)version-info.h): Fix typo in previous change.
Sat Sep 28 00:44:38 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/euidaccess.c (__set_errno): Fix typo.
Sat Sep 28 00:40:38 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* malloc/free.c (_free_internal): Don't call free recursively, use
the internal functions instead.
Sat Sep 28 00:23:20 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/tempname.c (__stdio_gen_tempname) [USE_IN_LIBIO &&
_IO_MTSAFE_IO]: Allocate and initialize the file lock.
Fri Sep 27 23:58:17 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* catgets/gencat.c (main): Print version information on stdout,
not stderr.
* db/makedb.c: Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.
Mon Sep 30 00:14:26 1996 Ulrich Drepper <drepper@cygnus.com>
Add implementation of netgroup.
* inet/Makefile (distributes): Add netgroup.h.
(routines): Add getnetgrent.c and getnetgrent_r.c.
* inet/getnetgrent.c: New file.
* inet/getnetgrent_r.c: New file.
* inet/netgroup.h: New file.
* netgroup.h: New file.
* nsswitch.h: New file.
* nss/Makefile (databases): Add getgrp.
* nss/databases.def: Add netgroup.
* nss/db-Makefile: Add rules for netgroup.
* nss/netgrp-lookup.c: New file.
* nss/nss.h: Add new status value NSS_STATUS_RETURN which will
always return without a check of the transition table.
* nss/nsswitch.h (struct service_user): Extend actions array to
five elements.
* nss/nsswitch.c (__nss_next): Allow NSS_STATUS_RETURN as legal
status value.
(nss_parse_service_list): Initialize action for NSS_STATUS_RETURN
to NSS_ACTION_RETURN.
* nss/nss_db/db-netgrp.c: New file.
* nss/nss_files/files-netgrp.c: New file.
* nss/nsswitch.conf: Add entry for netgroup.
* resolv/netdb.h: Add prototypes for netgroup functions.
* nss/nss_db/db-XXX.c: Use `enum nss_status' type when status
value is used.
Sun Sep 29 12:55:58 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Change funciton name for
_llseek to _llseek (not llseek).
Reported by Matthias Urlichs <smurf@smurf.noris.de>.
Sun Sep 29 05:34:32 1996 Ulrich Drepper <drepper@cygnus.com>
* inet/rcmd.c: Remove definition of MIN.
Sat Sep 28 14:22:51 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/readdir_r.c: Removed. We indeed need a real implementation.
* sysdeps/unix/readdir_r.c: New file.
* sysdeps/unix/readdir.c: Remove check for correct parameter
values. Let them simply die.
* manual/filesys.texi: Document readdir_r.
* sysdeps/gnu/errlist.awk: Define _sys_errlist as `const char* const'.
Proposed by Per Abrahamsen <abraham@dina.kvl.dk>.
1996-10-06 02:05:11 +00:00
|
|
|
#ifdef NO_LONG_DOUBLE
|
2001-03-12 00:04:52 +00:00
|
|
|
weak_alias (tan, tanl)
|
update from main archive 961005
Sun Oct 6 02:05:52 1996 Ulrich Drepper <drepper@cygnus.com>
* posix/getopt.c: Add casts to prevent warnings.
* posix/regex.c: Likewise.
* math/Makefile (long-m-routines, long-m-yes): Define to correct
values to make `long double' functions available.
(distribute): Add $(long-m-yes:=.c).
* sysdeps/libm-i387/s_ceill.S: Correct loading of return value.
Use long double instruction.
* sysdeps/libm-ieee754/e_atanhl.c (huge): Correct constant.
* sysdeps/libm-ieee754/e_asinhl.c: Likewise.
* sysdeps/libm-ieee754/s_tanhl.c: Likewise.
* sysdeps/libm-ieee754/e_coshl.c: New file.
* sysdeps/libm-ieee754/s_asinh.c [!NO_LONG_DOUBLE]: Define names
for `long double' version as alias.
* sysdeps/libm-ieee754/s_atan.c: Likewise.
* sysdeps/libm-ieee754/s_cbrt.c: Likewise.
* sysdeps/libm-ieee754/s_ceil.c: Likewise.
* sysdeps/libm-ieee754/s_copysign.c: Likewise.
* sysdeps/libm-ieee754/s_cos.c: Likewise.
* sysdeps/libm-ieee754/s_erf.c: Likewise.
* sysdeps/libm-ieee754/s_expm1.c: Likewise.
* sysdeps/libm-ieee754/s_fabs.c: Likewise.
* sysdeps/libm-ieee754/s_finite.c: Likewise.
* sysdeps/libm-ieee754/s_floor.c: Likewise.
* sysdeps/libm-ieee754/s_frexp.c: Likewise.
* sysdeps/libm-ieee754/s_ilogb.c: Likewise.
* sysdeps/libm-ieee754/s_ldexp.c: Likewise.
* sysdeps/libm-ieee754/s_log1p.c: Likewise.
* sysdeps/libm-ieee754/s_logb.c: Likewise.
* sysdeps/libm-ieee754/s_modf.c: Likewise.
* sysdeps/libm-ieee754/s_nextafter.c: Likewise.
* sysdeps/libm-ieee754/s_rint.c: Likewise.
* sysdeps/libm-ieee754/s_scalbn.c: Likewise.
* sysdeps/libm-ieee754/s_significand.c: Likewise.
* sysdeps/libm-ieee754/s_sin.c: Likewise.
* sysdeps/libm-ieee754/s_tan.c: Likewise.
* sysdeps/libm-ieee754/s_tanh.c: Likewise.
* sysdeps/libm-ieee754/w_acos.c: Likewise.
* sysdeps/libm-ieee754/w_acosh.c: Likewise.
* sysdeps/libm-ieee754/w_sin.c: Likewise.
* sysdeps/libm-ieee754/w_atan2.c: Likewise.
* sysdeps/libm-ieee754/w_atanh.c: Likewise.
* sysdeps/libm-ieee754/w_cabs.c: Likewise.
* sysdeps/libm-ieee754/w_cosh.c: Likewise.
* sysdeps/libm-ieee754/w_drem.c: Likewise.
* sysdeps/libm-ieee754/w_exp.c: Likewise.
* sysdeps/libm-ieee754/w_fmod.c: Likewise.
* sysdeps/libm-ieee754/w_gamma.c: Likewise.
* sysdeps/libm-ieee754/w_gamma_r.c: Likewise.
* sysdeps/libm-ieee754/w_hypot.c: Likewise.
* sysdeps/libm-ieee754/w_j0.c: Likewise.
* sysdeps/libm-ieee754/w_j1.c: Likewise.
* sysdeps/libm-ieee754/w_jn.c: Likewise.
* sysdeps/libm-ieee754/w_lgamma.c: Likewise.
* sysdeps/libm-ieee754/w_lgamma_r.c: Likewise.
* sysdeps/libm-ieee754/w_log.c: Likewise.
* sysdeps/libm-ieee754/w_log10.c: Likewise.
* sysdeps/libm-ieee754/w_pow.c: Likewise.
* sysdeps/libm-ieee754/w_remainder.c: Likewise.
* sysdeps/libm-ieee754/w_scalb.c: Likewise.
* sysdeps/libm-ieee754/w_sinh.c: Likewise.
* sysdeps/libm-ieee754/w_sqrt.c: Likewise.
Stub files for missing long double math functions.
* sysdeps/stub/e_acoshl.c: New file.
* sysdeps/stub/e_hypotl.c: New file.
* sysdeps/stub/e_j0l.c: New file.
* sysdeps/stub/e_j1l.c: New file.
* sysdeps/stub/e_jnl.c: New file.
* sysdeps/stub/e_lgammal_r.c: New file.
* sysdeps/stub/e_powl.c: New file.
* sysdeps/stub/e_rem_pio2l.c: New file.
* sysdeps/stub/e_sinhl.c: New file.
* sysdeps/stub/k_cosl.c: New file.
* sysdeps/stub/k_rem_pio2l.c: New file.
* sysdeps/stub/k_sinl.c: New file.
* sysdeps/stub/k_tanl.c: New file.
* sysdeps/stub/s_erfl.c: New file.
* sysdeps/stub/s_expm1l.c: New file.
* sysdeps/i386/__longjmp.S: Use PSEUDO_END macro to provide
.size directive.
* sysdeps/i386/bsd-_setjmp.S: Likewise.
* sysdeps/i386/bsd-setjmp.S: Likewise.
* sysdeps/i386/memchr.S: Likewise.
* sysdeps/i386/memcmp.S: Likewise.
* sysdeps/i386/setjmp.S: Likewise.
* sysdeps/i386/stpcpy.S: Likewise.
* sysdeps/i386/stpncpy.S: Likewise.
* sysdeps/i386/strchr.S: Likewise.
* sysdeps/i386/strcspn.S: Likewise.
* sysdeps/i386/strpbrk.S: Likewise.
* sysdeps/i386/strrchr.S: Likewise.
* sysdeps/i386/strspn.S: Likewise.
* sysdeps/i386/strtok.S: Likewise.
* sysdeps/i386/i486/strcat.S: Likewise.
* sysdeps/i386/i486/strlen.S: Likewise.
* sysdeps/i386/i586/memset.S: Likewise.
* sysdeps/i386/i586/strchr.S: Likewise.
* sysdeps/i386/i586/strlen.S: Likewise.
* sysdeps/libm-i387/e_acos.S: Likewise.
* sysdeps/libm-i387/e_acosl.S: Likewise.
* sysdeps/libm-i387/e_asin.S: Likewise.
* sysdeps/libm-i387/e_asinl.S: Likewise.
* sysdeps/libm-i387/e_atan2.S: Likewise.
* sysdeps/libm-i387/e_atan2l.S: Likewise.
* sysdeps/libm-i387/e_exp.S: Likewise.
* sysdeps/libm-i387/e_expl.S: Likewise.
* sysdeps/libm-i387/e_fmod.S: Likewise.
* sysdeps/libm-i387/e_fmodl.S: Likewise.
* sysdeps/libm-i387/e_log.S: Likewise.
* sysdeps/libm-i387/e_log10.S: Likewise.
* sysdeps/libm-i387/e_log10l.S: Likewise.
* sysdeps/libm-i387/e_logl.S: Likewise.
* sysdeps/libm-i387/e_remainder.S: Likewise.
* sysdeps/libm-i387/e_remainderf.S: Likewise.
* sysdeps/libm-i387/e_remainderl.S: Likewise.
* sysdeps/libm-i387/e_scalb.S: Likewise.
* sysdeps/libm-i387/e_scalbl.S: Likewise.
* sysdeps/libm-i387/e_sqrt.S: Likewise.
* sysdeps/libm-i387/e_sqrtf.S: Likewise.
* sysdeps/libm-i387/e_sqrtl.S: Likewise.
* sysdeps/libm-i387/s_atan.S: Likewise.
* sysdeps/libm-i387/s_atanf.S: Likewise.
* sysdeps/libm-i387/s_atanl.S: Likewise.
* sysdeps/libm-i387/s_ceil.S: Likewise.
* sysdeps/libm-i387/s_ceilf.S: Likewise.
* sysdeps/libm-i387/s_ceill.S: Likewise.
* sysdeps/libm-i387/s_copysign.S: Likewise.
* sysdeps/libm-i387/s_copysignf.S: Likewise.
* sysdeps/libm-i387/s_copysignl.S: Likewise.
* sysdeps/libm-i387/s_cos.S: Likewise.
* sysdeps/libm-i387/s_cosf.S: Likewise.
* sysdeps/libm-i387/s_cosl.S: Likewise.
* sysdeps/libm-i387/s_finite.S: Likewise.
* sysdeps/libm-i387/s_finitef.S: Likewise.
* sysdeps/libm-i387/s_finitel.S: Likewise.
* sysdeps/libm-i387/s_floor.S: Likewise.
* sysdeps/libm-i387/s_floorf.S: Likewise.
* sysdeps/libm-i387/s_floorl.S: Likewise.
* sysdeps/libm-i387/s_ilogb.S: Likewise.
* sysdeps/libm-i387/s_ilogbf.S: Likewise.
* sysdeps/libm-i387/s_ilogbl.S: Likewise.
* sysdeps/libm-i387/s_log1p.S: Likewise.
* sysdeps/libm-i387/s_log1pf.S: Likewise.
* sysdeps/libm-i387/s_log1pl.S: Likewise.
* sysdeps/libm-i387/s_logb.S: Likewise.
* sysdeps/libm-i387/s_logbf.S: Likewise.
* sysdeps/libm-i387/s_logbl.S: Likewise.
* sysdeps/libm-i387/s_rint.S: Likewise.
* sysdeps/libm-i387/s_rintf.S: Likewise.
* sysdeps/libm-i387/s_rintl.S: Likewise.
* sysdeps/libm-i387/s_scalbn.S: Likewise.
* sysdeps/libm-i387/s_scalbnf.S: Likewise.
* sysdeps/libm-i387/s_scalbnl.S: Likewise.
* sysdeps/libm-i387/s_significand.S: Likewise.
* sysdeps/libm-i387/s_significandf.S: Likewise.
* sysdeps/libm-i387/s_significandl.S: Likewise.
* sysdeps/libm-i387/s_sin.S: Likewise.
* sysdeps/libm-i387/s_sinf.S: Likewise.
* sysdeps/libm-i387/s_sinl.S: Likewise.
* sysdeps/libm-i387/s_tan.S: Likewise.
* sysdeps/libm-i387/s_tanf.S: Likewise.
* sysdeps/libm-i387/s_tanl.S: Likewise.
* sysdeps/unix/sysv/linux/i386/clone.S: Add .size directive.
* sysdeps/unix/sysv/linux/i386/mmap.S. Likewise.
* sysdeps/unix/sysv/linux/i386/socket.S. Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.S. More compact .size line.
* sysdeps/i386/sysdep.h (ASM_SIZE_DIRECTIVE): New macro. Used
to provide .size directive on ELF systems.
* sysdeps/unix/sysv/linux/i386/profil-counter.h: Include
<sigcontext.h> and rename parameter type to sigcontext.
* sysdeps/unix/sysv/linux/i386/sigcontext.h New file.
* sysdeps/unix/sysv/linux/i386/syscall.S: From Linux 2.1 on
negative values might occur as positive results. Test against
-125 to decide for error or not.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise for system calls.
Thu Oct 3 21:07:58 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dl-open.c: Use _DYNAMIC instead of _dl_start to decide
whether this is a statically linked program. The latter is now
always defined.
Fri Oct 4 02:08:10 1996 Bang Jun-Young <bangjy@nownuri.nowcom.co.kr>
* po/ko.po: Update.
Fri Oct 4 02:07:46 1996 Michel Robitaille <robitail@IRO.UMontreal.CA>
* po/fr.po: New file.
Fri Oct 4 05:04:52 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/sigcontext.h: New file.
Add support for MD5 crypt replacement.
* Makefile (subdirs): Add crypt.
* shlib-versions: Add entry for libcrypt.
* crypt/md5-crypt.c: New file.
* crypt/md5.c: New file.
* crypt/md5.h: New file.
* sysdeps/generic/crypt-entry.c: New file.
* sysdeps/generic/crypt.h: New file.
Thu Oct 3 20:53:23 1996 Andreas Jaeger <aj@arthur.pfalz.de>
* dirent/tst-seekdir.c: Provide correct prototypes.
* io/test-utime.c: Likewise.
* malloc/mallocbug.c: Likewise.
* posix/testfnm.c: Likewise.
* stdio-common/xbug.c: Likewise.
* sysdeps/posix/cuserid.c: Likewise.
Wed Oct 2 13:33:48 1996 Richard Henderson <rth@tamu.edu>
Provide optimized string functions for Alpha processors.
* sysdeps/alpha/bzero.S: New file.
* sysdeps/alpha/memset.S: New file.
* sysdeps/alpha/stpcpy.S: New file.
* sysdeps/alpha/stpncpy.S: New file.
* sysdeps/alpha/strcat.S: New file.
* sysdeps/alpha/strchr.S: New file.
* sysdeps/alpha/strcpy.S: New file.
* sysdeps/alpha/strncat.S: New file.
* sysdeps/alpha/strncpy.S: New file.
* sysdeps/alpha/strrchr.S: New file.
* sysdeps/alpha/stxcpy.S: New file.
* sysdeps/alpha/stxncpy.S: New file.
* sysdeps/alpha/Makefile [$(sudir)==string]: Add stxcpy and
stxncpy to sysdep_routines.
Minor correction.
Wed Oct 2 13:41:48 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/strtok.c: Don't set stored pointer to NULL when
notheing is found. This guarantees all subsequent calls behave
the same.
* sysdeps/generic/strtok_r.c: Likewise.
Mon Sep 30 22:27:36 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/tempname.c (__stdio_gen_tempname): Don't declare
`i' as const.
Mon Sep 30 22:38:29 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/generic/strtok.c: When we hit EOS, don't set olds to
NULL immediately; we're going to get called one more time.
* sysdeps/generic/strtok_r.c: Likewise.
Tue Oct 1 09:12:21 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/ld-time.c: Always write some bytes at the end of
the file even if no `era's are specified.
* stdio-common/tmpname.c (tmpbuf): Don't define as array of
pointers.
Tue Oct 1 01:43:11 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/iofclose.c: Move unlocking to right position.
Mon Sep 30 03:08:34 1996 Richard Henderson <rth@tamu.edu>
* misc/Makefile: Kill force-wrapper.
* misc/force-wrapper.c: Delete.
* elf/eval.c: Add <string.h>.
* gmon/sys/gmon_out.h: Nonsense like `char foo[sizeof(char*)]'
followed by `bcopy(&ptr, &foo, sizeof(foo))' helps portability
and binary compatibility not at all. Better to do `char *foo'
followed by `foo = ptr' as it is much cleaner.
(struct gmon_hdr): Fix version.
(struct gmon_hist_hdr): Fix low_pc, high_pc, hist_size, prof_rate.
(struct gmon_cg_arc_record): Fix from_pc, self_pc, count.
* gmon/gmon.c: De-ansidecl-ify.
(write_hist): De-bcopy-fy.
(write_call_graph): Likewise.
* gmon/mcount.c: Assume _MCOUNT_DECL does the entire declaration.
* sysdeps/alpha/machine-gmon.h: Update _MCOUNT_DECL.
* sysdeps/generic/machine-gmon.h: Likewise.
* resolv/netdb.h: Add __set_h_errno to mimic __set_errno.
* nss/getXXent_r.c: Use __set_h_errno to set h_errno in all funcs.
* nss/nss_dns/dns-network.c: Likewise.
* resolv/getunamaddr.c: Likewise. Also use __set_errno where needed.
* resolv/getnetnamadr.c: Likewise.
* resolv/res_debug.c: Likewise.
* resolv/res_mkquery.c: Likewise.
* resolv/res_query.c: Likewise.
* libio/clearerr_u.c: It's not necessary to define __ protected
function so don't do it.
* libio/feof_u.c, libio/ferror_u.c, libio/fputc_u.c,
libio/getc_u.c, libio/getchar_u.c, libio/iofflush_u.c: Likewise.
* libio/fgetc.c: Avoid a warning by casting _IO_funlockfile for
the cleanup registrar.
* libio/fputc.c, libio/freopen.c, libio/fseek.c, libio/getc.c,
libio/getchar.c, libio/iofclose.c, libio/iofflush.c,
libio/iofgetpos.c, libio/iofgets.c, libio/iofputs.c,
libio/iofread.c, libio/iofsetpos.c, libio/ioftell.c,
libio/iofwrite.c, libio/iogetdelim.c, libio/iogets.c,
libio/ioputs.c, libio/iosetbuffer.c, libio/iosetvbuf.c,
libio/ioungetc.c, libio/putc.c, libio/putchar.c, libio/rewind.c:
Likewise.
* locale/programs/ld-ctype.c: Include <alloca.h>.
* login/login_tty.c: Get login_tty prototype from <utmp.h>.
* posix/sys/types.h: Change #defines to typedefs. This is looking
forward to more comprehensive namespace cleanups for C++.
* posix/unistd.h: Likewise for ssize_t.
* pwd/getpw.c: Prototype and rename getpw -> __getpw and add a
weak alias.
* resolv/base64.c: Don't do `for (NULL; ...)' as it causes
`statement with no effect' warnings.
* resolv/inet_neta.c: Include <string.h> for strlen.
* stdio-common/getline.c: Undef ssize_t before libio redefinition.
* stdio-common/tstgetln.c: Same. De-ansidecl-ify.
* stdio-common/vfprintf.c: Same for va_list.
* stdio-common/vfscanf.c: Same.
* stdio-common/reg-printf.c: Prototype the __ function.
* stdio-common/scanf.c [USE_IN_LIBIO]: Include <libioP.h> for
_IO_vscanf declaration.
* string/tester.c: Tsk, tsk. Don't cast pointers to int,
but to unsigned long for the health of 64-bit systems.
* sunrpc/svc_udp.c: Define MAX only if we don't have it yet.
Many system's <sys/param.h> pulls this in.
* sysdeps/generic/dl-cache.c: Kill the bottom half of the
patch doubled file.
* sysdeps/generic/pty.c (forkpty): Get login_tty decl from <utmp.h>
instead of defining it locally.
* sysdeps/posix/sigvec.c: Prototype wrapper_handler and convert_mask.
* sysdeps/stub/chflags.c: Prototype chflags.
* sysdeps/stub/fchflags.c: Prototype fchflags.
* sysdeps/stub/sstk.c: Prototype sstk.
* sysdeps/unix/alpha/sysdep.S: Add strong alias from errno
variable to __errno. Update __syscall_error to store to both
the global and per-thread variables.
* sysdeps/unix/sysv/linux/init-first.c: Change include of
init-first.h from "" to <> as "" does not search the include path.
Prototype _dl_start.
Sun Sep 29 14:41:17 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/Makefile ($(common-objpfx)s-proto.d): Make it a
pattern rule to get the right stem.
Sat Sep 28 01:30:06 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(objpfx)version-info.h): Fix typo in previous change.
Sat Sep 28 00:44:38 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/euidaccess.c (__set_errno): Fix typo.
Sat Sep 28 00:40:38 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* malloc/free.c (_free_internal): Don't call free recursively, use
the internal functions instead.
Sat Sep 28 00:23:20 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/posix/tempname.c (__stdio_gen_tempname) [USE_IN_LIBIO &&
_IO_MTSAFE_IO]: Allocate and initialize the file lock.
Fri Sep 27 23:58:17 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* catgets/gencat.c (main): Print version information on stdout,
not stderr.
* db/makedb.c: Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.
Mon Sep 30 00:14:26 1996 Ulrich Drepper <drepper@cygnus.com>
Add implementation of netgroup.
* inet/Makefile (distributes): Add netgroup.h.
(routines): Add getnetgrent.c and getnetgrent_r.c.
* inet/getnetgrent.c: New file.
* inet/getnetgrent_r.c: New file.
* inet/netgroup.h: New file.
* netgroup.h: New file.
* nsswitch.h: New file.
* nss/Makefile (databases): Add getgrp.
* nss/databases.def: Add netgroup.
* nss/db-Makefile: Add rules for netgroup.
* nss/netgrp-lookup.c: New file.
* nss/nss.h: Add new status value NSS_STATUS_RETURN which will
always return without a check of the transition table.
* nss/nsswitch.h (struct service_user): Extend actions array to
five elements.
* nss/nsswitch.c (__nss_next): Allow NSS_STATUS_RETURN as legal
status value.
(nss_parse_service_list): Initialize action for NSS_STATUS_RETURN
to NSS_ACTION_RETURN.
* nss/nss_db/db-netgrp.c: New file.
* nss/nss_files/files-netgrp.c: New file.
* nss/nsswitch.conf: Add entry for netgroup.
* resolv/netdb.h: Add prototypes for netgroup functions.
* nss/nss_db/db-XXX.c: Use `enum nss_status' type when status
value is used.
Sun Sep 29 12:55:58 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Change funciton name for
_llseek to _llseek (not llseek).
Reported by Matthias Urlichs <smurf@smurf.noris.de>.
Sun Sep 29 05:34:32 1996 Ulrich Drepper <drepper@cygnus.com>
* inet/rcmd.c: Remove definition of MIN.
Sat Sep 28 14:22:51 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/readdir_r.c: Removed. We indeed need a real implementation.
* sysdeps/unix/readdir_r.c: New file.
* sysdeps/unix/readdir.c: Remove check for correct parameter
values. Let them simply die.
* manual/filesys.texi: Document readdir_r.
* sysdeps/gnu/errlist.awk: Define _sys_errlist as `const char* const'.
Proposed by Per Abrahamsen <abraham@dina.kvl.dk>.
1996-10-06 02:05:11 +00:00
|
|
|
#endif
|