This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: correct rounding or not?
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "Paul dot Zimmermann at inria dot fr" <Paul dot Zimmermann at inria dot fr>
- Cc: 'GNU C Library' <libc-alpha at sourceware dot org>
- Date: Thu, 30 Jan 2020 13:05:26 +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=DLt+e/4PMU5yVmDjlX8L5KDM5o6SyEI4D1SvlIDCrG4=; b=IsNPEP/eQ9GRQiHTejH74bFO2YIbsMvTjkwsLVRMYiOgQ9OSY5ovmg2Hb+sYDhLkh//sqZeadUje6z0TtWISWpYFkgNFjlkneF+q8V35COTLDtwhv2ILQBoW1UhIOi0YkxIYhTyEMxiu7HCtEBsV+nKY2oujOlxDQbYy0KDC3+AaFUtbHq0+D3eReuBL5sHlDQM3BXkinoHZPLlO92qczxRDB8BWdjFrKMhQoBQV9QBYbhGKzNRP31VIJLTRgz1ZAGOjqgI9cCHvlMcXfhjPDovffYg8zw9soCZ33wc2exD2j5vT70uFvWAa8uCMgcfjPyYWeM8ECI6cloPdUXVoag==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XRWvNq+kk/qn7wEnfz1YOS635C0jNBw/It8VP8quZHeDpFO5QvPl1IqjWWwOKEXv9N/V6nY0eIl+1lBqFbmUGb2IgxVUDs1wbULWlXkYOYgW4AwtCqNiM8DrM/om7VFQVwi/wRyhDNxyS+j6eMY9tDGKcxX4dhHmV4w5nGoTsPDQJn/nS+iZ5/b1XfHzdj+65gDQG9MveQMEs/Orghix19T0kSAEVfueUPXL06vILNG3dT5v0oY3e4dnjEUyjYBBlRNk3d9d5j4XC1NmwSmIboY99BK/AIUSsB+YpBZ5exgaOfoyJH1dBdIEiwZPZvAdDSvEVSUfNS563q7aBAxDTA==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
Hi Paul,
/*******************************************************************/
/* An ultimate sin routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of sin(x) */
/*******************************************************************/
> Anyway, I believe the comments should be modified to accurately
> describe what the current code does.
Yes that comment is out of date - I have posted a patch to fix that [1].
This math code is ancient, extremely slow and buggy, so the plan is to
rewrite like we've done with exp(2)(f)/pow(f)/log(f)/sinf/cosf/sincosf.
There is ongoing work to remove the slow paths first [2], since that causes
the huge 100x slowdowns that most people are complaining about.
Rewriting the actual math code then gives another 2-5x gain.
Cheers,
Wilco
[1] https://www.sourceware.org/ml/libc-alpha/2020-01/msg00647.html
[2] https://www.sourceware.org/ml/libc-alpha/2020-01/msg00574.html