From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ATCSQR.andestech.com (atcsqr.andestech.com [60.248.187.195]) by sourceware.org (Postfix) with ESMTPS id E80393857C57 for ; Tue, 8 Sep 2020 11:05:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E80393857C57 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ruinland@andestech.com Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 088AqROX070731; Tue, 8 Sep 2020 18:52:27 +0800 (GMT-8) (envelope-from ruinland@andestech.com) Received: from APC301.andestech.com (10.0.12.128) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Tue, 8 Sep 2020 19:04:47 +0800 Date: Tue, 8 Sep 2020 19:02:14 +0800 From: Ruinland ChuanTzu Tsai To: Joseph Myers CC: , Subject: Re: In libm, sin(qNaN) doesn't expect FE_INVALID ? Message-ID: <20200908110214.GA3365@APC301.andestech.com> References: <20200903123442.GA5266@APC301.andestech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.0.12.128] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 088AqROX070731 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 11:05:06 -0000 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