some more fixes

This commit is contained in:
ceriel 1989-05-18 18:02:24 +00:00
parent e431cec90a
commit efe2c8d032
2 changed files with 15 additions and 8 deletions

View file

@ -40,7 +40,7 @@ asin_acos(x, cosfl)
x = -x;
}
if (x > 0.5) {
i = 1 - cosfl;
i = 1;
if (x > 1) {
errno = EDOM;
return 0;
@ -51,16 +51,18 @@ asin_acos(x, cosfl)
}
else {
/* ??? avoid underflow ??? */
i = 0;
g = x * x;
}
x += x * g * POLYNOM4(g, p) / POLYNOM5(g, q);
if (i == 1) {
if (cosfl == 0 || ! negative) {
x = (x + M_PI_4) + M_PI_4;
}
else if (cosfl && negative) {
x = (x + M_PI_2) + M_PI_2;
}
if (cosfl) {
if (! negative) x = -x;
}
if ((cosfl == 0) == (i == 1)) {
x = (x + M_PI_4) + M_PI_4;
}
else if (cosfl && negative && i == 1) {
x = (x + M_PI_2) + M_PI_2;
}
if (! cosfl && negative) x = -x;
return x;

View file

@ -46,6 +46,7 @@ exp(x)
if (x > M_LN_MAX_D) errno = ERANGE;
return M_MAX_D;
}
if (negative) x = -x;
/* ??? avoid underflow ??? */
@ -57,6 +58,10 @@ exp(x)
g = ((x1-xn*0.693359375)+x2) - xn*(-2.1219444005469058277e-4);
}
if (negative) {
g = -g;
n = -n;
}
xn = g * g;
x = g * POLYNOM2(xn, p);
n += 1;