Mercurial > hg > octave-lyh > gnulib-hg
changeset 9923:810b08d769f8
fix typos in mathl
2008-04-15 Paolo Bonzini <bonzini@gnu.org>
* lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it
to 0.
* lib/trigl.c (ieee754_rem_pio2l): Fix range checks.
author | Paolo Bonzini <bonzini@gnu.org> |
---|---|
date | Tue, 15 Apr 2008 15:25:38 +0200 |
parents | 5bd19352e8c2 |
children | 01ca1a0b2ebe |
files | ChangeLog lib/tanl.c lib/trigl.c |
diffstat | 3 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-15 Paolo Bonzini <bonzini@gnu.org> + + * lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it + to 0. + * lib/trigl.c (ieee754_rem_pio2l): Fix range checks. + 2008-04-14 Bruno Haible <bruno@clisp.org> * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Fix underquoting of
--- a/lib/tanl.c +++ b/lib/tanl.c @@ -125,7 +125,7 @@ kernel_tanl (long double x, long double y, int iy) { long double z, r, v, w, s, u, u1; - int flag, sign; + int invert = 0, sign; sign = 1; if (x < 0) @@ -147,7 +147,7 @@ } if (x >= 0.6743316650390625) /* |x| >= 0.6743316650390625 */ { - flag = 1; + invert = 1; z = pio4hi - x; w = pio4lo - y; @@ -163,7 +163,7 @@ r = y + z * (s * r + y); r += TH * s; w = x + r; - if (flag) + if (invert) { v = (long double) iy; w = (v - 2.0 * (x - (w * w / (w + v) - r)));
--- a/lib/trigl.c +++ b/lib/trigl.c @@ -205,7 +205,7 @@ int exp, n; if (x >= -0.78539816339744830961566084581987572104929234984377 - && x < 0.78539816339744830961566084581987572104929234984377) + && x <= 0.78539816339744830961566084581987572104929234984377) /* x in <-pi/4, pi/4> */ { y[0] = x; @@ -213,9 +213,7 @@ return 0; } - if (x >= 2.35619449019234492884698253745962716314787704953131 - && x < 2.35619449019234492884698253745962716314787704953131) - if (x > 0) + if (x > 0 && x < 2.35619449019234492884698253745962716314787704953131) { /* 113 + 93 bit PI is ok */ z = x - PI_2_1; @@ -223,7 +221,8 @@ y[1] = (z - y[0]) - PI_2_1t; return 1; } - else + + if (x < 0 && x > -2.35619449019234492884698253745962716314787704953131) { /* 113 + 93 bit PI is ok */ z = x + PI_2_1;