From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9109 invoked from network); 3 Jan 2022 13:08:14 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Jan 2022 13:08:14 -0000 Received: (qmail 1363 invoked by uid 550); 3 Jan 2022 13:08:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1315 invoked from network); 3 Jan 2022 13:08:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:message-id:from:to:cc:subject; bh=zo5Ufm/PxfAN2iA+QSylAOEbxXlKMpl6wJQ8A0czXL8=; b=tT46FxdWyx+2v4zPArSExoGjhfCvJn4Mi6Sm54YkPcLccGu+AqKrYPr5 U7CKcgdoXVtDMdkBFeZZQC052oGFHfA/5ZrOP/f2alPkSdw3/OCDQV1ZC in8Q8vwRwjczsPf1YsCiivcDHhODq84GlYXhhNuwiCx+EsoY+4XZSsMDL 0=; IronPort-Data: =?us-ascii?q?A9a23=3AQSoUjKvkgr/Jc1YYQOovodHkCefnVL1cMUV32f8?= =?us-ascii?q?akzHdYEJGY0x3zmocW26Bb/uNNjemKtoibIm09B9UsZHWx4NnGlFppX9gHilAw?= =?us-ascii?q?SbnLYTAfx2oZ0t+DeWaERk5t51GAjX4wXFdokb0/n9BCZC86yksvU20buCkUrS?= =?us-ascii?q?cY3gqHVUMpBoJ0nqPpcZo2+aEvvDpW2thifuqyyHuEAfNNwxcagr42IrfwP9bh?= =?us-ascii?q?8kejRtD1rAIiV+ni3eF/5UdJMp3yahctBIUSKEMdgKxb76rIL1UYgrkExkR5tO?= =?us-ascii?q?Nyt4Xc2UWRbvbIQXmZnh+AvX4xEgb4HVqlPtiXBYfQR4/ZzGhp9lszJN/tJm1R?= =?us-ascii?q?B0sN6vKsOUbSRhRVS9kVUFD0Oaceifk6pLJp6HBWz62qxl0N2kUMIQev8N2CmF?= =?us-ascii?q?D8bo9NTQJYwqriuSthbaqTe8qiN5LBMLrJoIEpnZ4zXfdBOs6TIrrSKXQ5MRE2?= =?us-ascii?q?y8ww8RHAOrTfYweczUHRA/BaRxDEkoJCZl4l+7ArnziaDlwrFOOubFx5HDeyhN?= =?us-ascii?q?41LyrO93QEuFm7+09cl2wumXD9nj0RBUdLt2WjzSfmk9AT9TnxUvTML/+3pXhn?= =?us-ascii?q?hKyvGCu+w=3D=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3ACYTJRqye6uelTapI+uSwKrPwOb1zdoMgy1kn?= =?us-ascii?q?xilNoG9uE/Bw9vrEoB1173LJYVoqKRMdcJW7Scy9qBDnmaKdg7N6AV7KZmCPhI?= =?us-ascii?q?LrFvAA0WKI+VPd8kPFltK1mZ0OT5RD?= X-IronPort-AV: E=Sophos;i="5.88,258,1635199200"; d="scan'208";a="13373362" Date: Mon, 03 Jan 2022 14:07:59 +0100 Message-Id: From: Paul Zimmermann To: musl@lists.openwall.com CC: sibid@uvic.ca, christoph.lauter@christoph-lauter.org, Jean-Michel.Muller@ENS-LYON.FR Subject: [musl] correctly rounded mathematical functions Dear Musl developers, the current C working draft [1, p392] has reserved names for correctly rounded functions (cr_exp, cr_log, cr_sin, ...). We propose to provide such correctly rounded implementations for the three IEEE formats (binary32, binary64, binary128) and the "extended double" format (long double on x86_64). These implementations will be correctly rounded for all rounding modes, for example one could do the following to emulate interval arithmetic: fesetround (FE_DOWNWARD); y_lo = cr_exp (x_lo); fesetround (FE_UPWARD); y_hi = cr_exp (x_hi); Users who want a fast implementation will call the exp/log/sin/... functions, users who want a correctly rounded function and thus reproducible results (whatever the hardware, compiler or operating system) will use the cr_exp/cr_log/cr_sin/... functions. Our goal is nevertheless to get the best performance possible. Our objective is to provide open-source implementations that can be integrated in the major mathematical libraries (GNU libc, Intel Math Library, AMD Libm, Redhat Newlib, OpenLibm, Musl, llvm-libc, CUDA, ROCm). Are developers of Musl interested by such functions? If so, we could discuss what would be the requirements for integration in Musl in terms of license, table size, allowed operations. We have started to work on two functions (cbrt and acos), for which we provide presumably correctly rounded implementations (up to the knowledge of hard-to-round cases) [2]. Christoph Lauter Jean-Michel Muller Alexei Sibidanov Paul Zimmermann [1] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf [2] https://homepages.loria.fr/PZimmermann/CORE-MATH/