Closed jpellegrini closed 3 months ago
Previously we had
stklos> (acos 1) 0.0 stklos> (asin 0) 0
Hm, we have anice precise result for (asin 0), why not for (acos 1)? It's because for asin, we have:
(asin 0)
(acos 1)
case tc_integer: if (z == MAKE_INT(0)) return MAKE_INT(0); return asin_real(INT_VAL(z));
and for acos, we were also testing for exact zero, and then we returned inexact pi/2:
case tc_integer: if (z == MAKE_INT(0)) return div2(double2real(MY_PI), MAKE_INT(2));
But that's not necessary, because acos_real will do that anyway. And we were not testing for the nice case of (acos 1). Now we do that.
acos_real
One test was also adjusted.
Hi @jpellegrini,
That's perfect. Thanks. Merged.
Previously we had
Hm, we have anice precise result for
(asin 0)
, why not for(acos 1)
? It's because for asin, we have:and for acos, we were also testing for exact zero, and then we returned inexact pi/2:
But that's not necessary, because
acos_real
will do that anyway. And we were not testing for the nice case of(acos 1)
. Now we do that.One test was also adjusted.