Skip to content

Commit

Permalink
libm: Fix some whitespace issues in recent sincos additions.
Browse files Browse the repository at this point in the history
  • Loading branch information
riastradh authored and riastradh committed Aug 29, 2022
1 parent 1babbd6 commit 779858b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
24 changes: 12 additions & 12 deletions lib/libm/ld128/e_rem_pio2l.h
Expand Up @@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
Expand All @@ -19,8 +19,8 @@ __FBSDID("$FreeBSD: head/lib/msun/ld128/e_rem_pio2l.h 336545 2018-07-20 12:42:24
#endif

/* ld128 version of __ieee754_rem_pio2l(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/

Expand Down Expand Up @@ -85,32 +85,32 @@ __ieee754_rem_pio2l(long double x, long double *y)
union ieee_ext_u u2;
int ex1;
j = ex;
y[0] = r-w;
y[0] = r-w;
u2.extu_ld = y[0];
ex1 = u2.extu_exp;
i = j-ex1;
if(i>51) { /* 2nd iteration needed, good to 248 */
t = r;
w = fn*pio2_2;
w = fn*pio2_2;
r = t-w;
w = fn*pio2_2t-((t-r)-w);
w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
u2.extu_ld = y[0];
ex1 = u2.extu_exp;
i = j-ex1;
if(i>119) { /* 3rd iteration need, 316 bits acc */
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
}
y[1] = (r-y[0])-w;
return n;
}
/*
/*
* all other (large) arguments
*/
if(ex==0x7fff) { /* x is inf or NaN */
Expand Down
24 changes: 12 additions & 12 deletions lib/libm/ld80/e_rem_pio2l.h
Expand Up @@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
Expand All @@ -19,8 +19,8 @@ __FBSDID("$FreeBSD: head/lib/msun/ld80/e_rem_pio2l.h 336545 2018-07-20 12:42:24Z
#endif

/* ld80 version of __ieee754_rem_pio2l(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/

Expand Down Expand Up @@ -94,32 +94,32 @@ __ieee754_rem_pio2l(long double x, long double *y)
union ieee_ext_u u2;
int ex1;
j = ex;
y[0] = r-w;
y[0] = r-w;
u2.extu_ld = y[0];
ex1 = u2.extu_exp;
i = j-ex1;
if(i>22) { /* 2nd iteration needed, good to 141 */
t = r;
w = fn*pio2_2;
w = fn*pio2_2;
r = t-w;
w = fn*pio2_2t-((t-r)-w);
w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
u2.extu_ld = y[0];
ex1 = u2.extu_exp;
i = j-ex1;
if(i>61) { /* 3rd iteration need, 180 bits acc */
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
}
y[1] = (r-y[0])-w;
return n;
}
/*
/*
* all other (large) arguments
*/
if(ex==0x7fff) { /* x is inf or NaN */
Expand Down
24 changes: 12 additions & 12 deletions lib/libm/src/e_rem_pio2l.h
Expand Up @@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
Expand All @@ -17,8 +17,8 @@
__FBSDID("$FreeBSD: head/lib/msun/ld128/e_rem_pio2l.h 336545 2018-07-20 12:42:24Z bde $");

/* ld128 version of __ieee754_rem_pio2l(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/

Expand Down Expand Up @@ -83,32 +83,32 @@ __ieee754_rem_pio2l(long double x, long double *y)
union IEEEl2bits u2;
int ex1;
j = ex;
y[0] = r-w;
y[0] = r-w;
u2.e = y[0];
ex1 = u2.xbits.expsign & 0x7fff;
i = j-ex1;
if(i>51) { /* 2nd iteration needed, good to 248 */
t = r;
w = fn*pio2_2;
w = fn*pio2_2;
r = t-w;
w = fn*pio2_2t-((t-r)-w);
w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
u2.e = y[0];
ex1 = u2.xbits.expsign & 0x7fff;
i = j-ex1;
if(i>119) { /* 3rd iteration need, 316 bits acc */
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
}
y[1] = (r-y[0])-w;
return n;
}
/*
/*
* all other (large) arguments
*/
if(ex==0x7fff) { /* x is inf or NaN */
Expand Down
6 changes: 3 additions & 3 deletions lib/libm/src/k_sincos.h
Expand Up @@ -4,10 +4,10 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
*
* k_sin.c and k_cos.c merged by Steven G. Kargl.
*/

Expand All @@ -16,7 +16,7 @@
__FBSDID("$FreeBSD: head/lib/msun/src/k_sincos.h 319047 2017-05-28 06:13:38Z mmel $");
#endif
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: k_sincos.h,v 1.1 2022/08/27 08:31:59 christos Exp $");
__RCSID("$NetBSD: k_sincos.h,v 1.2 2022/08/29 01:48:34 riastradh Exp $");
#endif

static const double
Expand Down
8 changes: 4 additions & 4 deletions lib/libm/src/k_sincosl.h
Expand Up @@ -5,7 +5,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
Expand All @@ -17,7 +17,7 @@
__FBSDID("$FreeBSD: head/lib/msun/src/k_sincosl.h 354520 2019-11-07 23:57:48Z lwhsu $");
#endif
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: k_sincosl.h,v 1.1 2022/08/27 08:31:59 christos Exp $");
__RCSID("$NetBSD: k_sincosl.h,v 1.2 2022/08/29 01:48:34 riastradh Exp $");
#endif

#if LDBL_MANT_DIG == 64 /* ld80 version of k_sincosl.c. */
Expand Down Expand Up @@ -108,7 +108,7 @@ S11 = -0.38680813379701966970673724299207480965452616911420e-22,
S12 = 0.64038150078671872796678569586315881020659912139412e-25;

static inline void
__kernel_sincosl(long double x, long double y, int iy, long double *sn,
__kernel_sincosl(long double x, long double y, int iy, long double *sn,
long double *cs)
{
long double hz, r, v, w, z;
Expand All @@ -129,7 +129,7 @@ __kernel_sincosl(long double x, long double y, int iy, long double *sn,

hz = z / 2;
w = 1 - hz;
r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 +
r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 +
z * (C7 + z * (C8 + z * (C9 + z * (C10 + z * C11))))))))));

*cs = w + (((1 - w) - hz) + (z * r - x * y));
Expand Down
4 changes: 2 additions & 2 deletions lib/libm/src/s_sincos.c
Expand Up @@ -7,14 +7,14 @@
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
*
* s_sin.c and s_cos.c merged by Steven G. Kargl. Descriptions of the
* algorithms are contained in the original files.
*/

#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: s_sincos.c,v 1.4 2022/08/28 16:07:58 he Exp $");
__RCSID("$NetBSD: s_sincos.c,v 1.5 2022/08/29 01:48:34 riastradh Exp $");
#endif
#if 0
__FBSDID("$FreeBSD: head/lib/msun/src/s_sincos.c 319047 2017-05-28 06:13:38Z mmel $");
Expand Down

0 comments on commit 779858b

Please sign in to comment.