This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: correct rounding or not?
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: paul zimmermann <Paul dot Zimmermann at inria dot fr>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Wed, 29 Jan 2020 16:49:43 +0000
- Subject: Re: correct rounding or not?
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N53lPlb7VZw2KzGBV5AF9M5vFgkySzYYUbM3RqPybeM=; b=RIS5vgajWfSzfLb//6OiOvPQjKatRFkT/EDlMfg9TjDKXle7OfISfdMMcosHBZfCOlmxV7idKP+ZHC5j8Q0Y+M+E7ahDR/QGp0Ktigy94FHghaPlUQhJLAn9sQ6BmhBbt9eHeD2Hj2xmPLySUMGXYpwxBwNOQwroiy8Xmx7iHF4cu0OtXlxNN9SwoIcACRcgBC82N+V1/ihVZ2Qu53ase+zQoj4/I2MdhT3Wbv0jCZl9gD/vYMOM4rNerPnHxpUwEfbhYb8ZYD1kZDMXIv/tb/waQhKVsDYaGsxljrPkGzKWuj/rkDcFUngFWgJ+81PHYZuB0J8Ys1cL4XvwsLUdYg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RppQ+I5PHq2tM7gGfHlONqFhkgzc3Le3yHR+FgTMSscRCTCc7JzUQlNLe+ryPXKTQHX9k0PT4J5/RKI9zg0bzlpWj1Or64nYVJz/G/UGt/Lb8HZqT30r0XHyYfNNT6TvVvW5RLS9PBurAKPS6s8//5M62bTWZSrG3T/KFLBU5yZLqQwHj73UmrGC8kkOJudPddD/vx0JNPJ8Mo3cGd5OikDcdjNc0oaD5eWQ7rTotHAXdWa0y7ZeASxkO5sSNWhoajuWbUs1NucmfM+7DAL/4J04Bqw7KvgFWsrighAFly+yWYo/d7S4puxoOAGi17J7Cx92eKCk/NAsQZiGiZi2xQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- References: <mwy2tqi5j2.fsf@tomate.loria.fr>
On 29/01/2020 16:36, paul zimmermann wrote:
> Hi,
>
> in sysdeps/ieee754/dbl-64 one can find code coming from IBM's
> Accurate Mathematical Library (libultim), with comments claiming
> for correct rounding, for example in s_sin.c one can read around
> lines 194-197:
>
> /*******************************************************************/
> /* An ultimate sin routine. Given an IEEE double machine number x */
> /* it computes the correctly rounded (to nearest) value of sin(x) */
> /*******************************************************************/
> ...
> __sin (double x)
>
> However, it appears that the __sin function is not correctly rounded,
> for example for x=8.5546900000006210e-01 it gives 7.5487859961632653e-01
> whereas the correct rounding is 7.5487859961632664e-01 (according to mpfr).
>
> Maybe the original code from libultim was modified, in particular the
> code that guarantees correct rounding (rounding test + slow path) was
> removed?
>
> Anyway, I believe the comments should be modified to accurately
> describe what the current code does.
yes the comments were likely left untouched
when the slow paths were removed, i agree
that this should be fixed.