In libm, sin(qNaN) doesn't expect FE_INVALID ?
Ruinland ChuanTzu Tsai
ruinland@andestech.com
Tue Sep 8 11:02:14 GMT 2020
Hi Dr. Myers, Zanella and all,
thanks very, very, very much for your precious comment and explanation.
It's a wonderful piece for I to read and learn from.
I was caught up in the middle of something and I'm so sorry for this
late reply.
Currrently I'm trying to improve several trigonal functions inside libm
and conducting some expriments to check against testsuite.
If I may, I have another question upon sin,atan(±0x4p-1076), the test-
suite expects FE_UNDERFLOW being raised.
In `math/libm-test-{sin,atan}.inc` , I cannot see the corresponding
expectation being set.
And I discovered that in __sin() [sysdeps/ieee754/dbl-64/s_sin.c], it
will deliberately trigger the exception - -
```
if (k < 0x3e500000) /* if x->0 =>sin(x)=x */
{
math_check_force_underflow (x);
retval = x;
}
```
I've read IEEE Standard Section 7.5 which regulates that if a tiny non-
zero number is detected, an exception shall be raised. However I'm not
so sure about the reason why the magic number is set to `0x3e500000`.
Could you kindly point me to some directions about this magic number ?
Really appreciate the work and the comments from the community,
Ruinland ChuanTzu Tsai
More information about the Libc-alpha
mailing list