From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gtd-gmbh.de (mail.gtd.eu [46.24.46.35]) by sourceware.org (Postfix) with ESMTPS id 66AD93858D28 for ; Wed, 9 Feb 2022 14:32:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 66AD93858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gtd-gmbh.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gtd-gmbh.de X-MDAV-Result: clean X-MDAV-Processed: gtd-gmbh.de, Wed, 09 Feb 2022 15:27:23 +0100 Received: by gtd-gmbh.de (MDaemon PRO v21.0.3) with ESMTPSA id md5001016212202.msg; Wed, 09 Feb 2022 15:27:23 +0100 X-Spam-Processed: gtd-gmbh.de, Wed, 09 Feb 2022 15:27:23 +0100 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 109.90.104.197 X-MDArrival-Date: Wed, 09 Feb 2022 15:27:23 +0100 X-Authenticated-Sender: andoni.arregui@gtd-gmbh.de X-Return-Path: prvs=1039b972d0=andoni.arregui@gtd-gmbh.de X-Envelope-From: andoni.arregui@gtd-gmbh.de X-MDaemon-Deliver-To: newlib@sourceware.org Message-ID: Subject: Re: regression in Newlib 4.2.0 From: Andoni Arregi Reply-To: andoni.arregui@gtd-gmbh.de To: Paul Zimmermann , newlib@sourceware.org Date: Wed, 09 Feb 2022 15:27:22 +0100 In-Reply-To: References: Organization: GTD GmbH Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MDCFSigsAdded: gtd-gmbh.de X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Feb 2022 14:32:09 -0000 Dear Paul, although we could fix the problem you spotted, we don't really got to the root cause of the regression, i.e., this is not something that was introduced in Newlib 4.2.0 and was not present in 4.1.0. wf_expf.c didn't change in the meantime at all. The only explanation I have is that it may have to do with the fact that what you observed happens with the default compilation of Newlib. If you compile with -D_IEEE_LIBM, then you will not see this regression, as the wrappers for error handling disappear and with them the problem. It is a pity that for such a detailed analysis as the one you do, such a small change in the build mechanism yields you completely different implementations of the mathematical functions. I don't know whether Newlib 4.1.0 was built by default with _IEEE_LIBM defined. By the way, as we finished the work we have been carrying out for the European Space Agency to qualify a mathematical library for critical systems (which we based on the Newlib libm), we will now start submitting a bunch of improvement patches for the Newlib libm. We presented the LibmCS for the first time during the current Flight Software Workshop 2022 (http://flightsoftware.jhuapl.edu/workshop/FSW2022) https://www.youtube.com/watch?v=UcRefVlVL_A&list=PLK-T7jljJ6zbk0PshIwofgE2hiakBufJF&index=21 Best regards On Fri, 2022-02-04 at 05:36 +0100, Paul Zimmermann wrote: >        Hi, > > I noticed a regression in Newlib 4.2.0: > > Checking exp with newlib-4.2.0.20211231 > MPFR library: 4.1.0 > MPFR header:  4.1.0 (based on 4.1.0) > libm wrong by up to 1.94e+04 ulp(s) for x=0x1.62e302p+6 > exp      gives inf > mpfr_exp gives 0x1.ff691ep+127 > Total: errors=17982998 (0.42%) errors2=151 maxerr=1.94e+04 ulp(s) > > The largest error for expf in Newlib 4.1.0 was 0.911 ulps > (https://members.loria.fr/PZimmermann/papers/accuracy.pdf). > > Best regards, > Paul -- Andoni Arregi Geschäftsführer GTD GmbH Ravensburger Str. 32a, 88677 Markdorf T: +49 7544 96440 22 | M: +49 151 65620499 | F: +49 7544 96440 29 http://www.gtd-gmbh.de andoni.arregi@gtd-gmbh.de