From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id A18F83858C2C for ; Mon, 3 Jan 2022 12:57:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A18F83858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:message-id:from:to:cc:subject; bh=hWrSi8LcjyfVBi4vBoHyfMyQLyOBP6F+bIt4K/qlhF0=; b=T6uZrBLlBY/sTmntbNUx7Kdptrqrvnb54GO+HnXmw+iwOuxFiBvFdwGd 5GLZiumikMgBMtVk1jZZfHJVXunAMXBcPxaSPukxFIqt+GhRlfvuJq0Ql 6nvYiMPVUJ6bC+13S0Va3at3yUyePlLFdJiGRQd25awsQ85wa+8XlGc7K A=; IronPort-Data: =?us-ascii?q?A9a23=3AmzVQfKLlMthqGlAIFE+ROJclxSXFcZb7ZxGrkP8?= =?us-ascii?q?bfHC+1TglgmZWmGcaDDrSOKyOYmqkf41yOdzi8UsAsJPTmINqS1BcGVNFHysb8?= =?us-ascii?q?5KdbTi6Bh6tZH3KdpWroHqKXqzyU/GYRCwPZiKa9kfF3oTJ9yEmj/nRHuGkUoY?= =?us-ascii?q?oBwgqLeNaYHZ44f5cs75h6mJYqYDR7zKl4bsekeWHULOW82Ic3lYv1k62gEgHU?= =?us-ascii?q?MIeF98vlgdWifhj5DcynpSOZX4VDfnZw3DQGuG4EgMmLtsvwo1V/kuBl/ssIs+?= =?us-ascii?q?il7/nfyXmQJaLYFLI2iMQAvDk30EqSi8ai87XMNIkYFpTzQeImtV80tBEs5qYS?= =?us-ascii?q?AEzP6SKlv51vxxwSnolYvQeoeSvzX+X9Jb7I1f9W1nhyvMrKUA9PYAcvMNqBWV?= =?us-ascii?q?D79QVLitIagGEgaS42tqTQel2h98/K9HreocWp21t1xnSDewnWozEW6WP4dZFw?= =?us-ascii?q?DoqwMdUEp72fMsTaDZHcQrBaFtEMz8/Dp8hmOairmL4bidTpU2cv6dx5HLcpDG?= =?us-ascii?q?depCF3MH9ZtuPTNlY2EKfvGPPuWrjaiz2/ee3kVKtmk9ATMeV9c8jZL8vKQ=3D?= =?us-ascii?q?=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3Aa5vm+65/MrmBdvqznwPXwN3XdLJyesId70hD?= =?us-ascii?q?6qm+c3xom62j+vxG88506faZsl0ssTQb+OxoRpPrfZqsz/JICOAqVN+ftUvdyQ?= =?us-ascii?q?mVxepZgrcKrQeQeBEWjtQtsJtdTw=3D=3D?= X-IronPort-AV: E=Sophos;i="5.88,258,1635199200"; d="scan'208";a="13371013" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2022 13:57:51 +0100 Date: Mon, 03 Jan 2022 13:57:51 +0100 Message-Id: From: Paul Zimmermann To: newlib@sourceware.org CC: sibid@uvic.ca, christoph.lauter@christoph-lauter.org, Jean-Michel.Muller@ENS-LYON.FR Subject: correctly rounded mathematical functions X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Mon, 03 Jan 2022 12:57:54 -0000 Dear Newlib 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 Newlib interested by such functions? If so, we could discuss what would be the requirements for integration in Newlib 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/