From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: In libm, sin(qNaN) doesn't expect FE_INVALID ?
Date: Thu, 3 Sep 2020 10:19:29 -0300 [thread overview]
Message-ID: <eda0fdf7-84d4-d8c1-9e68-5f0dd5806540@linaro.org> (raw)
In-Reply-To: <20200903123442.GA5266@APC301.andestech.com>
On 03/09/2020 09:34, Ruinland ChuanTzu Tsai wrote:
> Hi all,
> sorry for the bothering.
>
> Recently, as I'm testing some modification on libm, I happen to realize
> the fact that glibc's testsutie doesn't expect sin(+-qNaN) to trigger
> FE_INVALID, which is designed in `math/libm-test-sin.inc` :
AFAIK this is the expected behavior for *quiet* NaN for most symbols, it should
not signal invalid exception where applicable.
>
> TEST_f_f (sin, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED)
> TEST_f_f (sin, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED)
>
> Yet I think that if the program issued sin(qNaN), it should be okay to
> be given an invalid operation excpetion.
>
> If that's the case, then appending `INVALID_EXCEPTION_OK` to the
> expected exception list of sin(qNaN) and sin(-qNaN) should be benign.
I think we should honor the quiet nan specification where applicable. Why
exactly are you trying to do that is requiring return a signaling NaN
for quiet NaN input?
>
> Though I'm neither an expert on libm nor IEEE standards, I'm wondering
> will there be any concern of such behavior ( raising FE_INVALID on
> sin(+-qNaN) ) ?
>
> Sincerely,
> Ruinland
>
next prev parent reply other threads:[~2020-09-03 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 12:34 Ruinland ChuanTzu Tsai
2020-09-03 13:19 ` Adhemerval Zanella [this message]
2020-09-03 17:03 ` Joseph Myers
2020-09-08 11:02 ` Ruinland ChuanTzu Tsai
2020-09-08 15:06 ` Joseph Myers
2020-09-10 13:49 ` Ruinland ChuanTzu Tsai
2020-09-10 15:26 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eda0fdf7-84d4-d8c1-9e68-5f0dd5806540@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).