This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: Jeff Law <law at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Giuliano Augusto Faulin Belinassi <giuliano dot belinassi at usp dot br>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "giuliano dot belinassi at gmail dot com" <giuliano dot belinassi at gmail dot com>, nd <nd at arm dot com>
- Date: Wed, 7 Nov 2018 19:43:17 -0600
- Subject: Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules
- References: <DB5PR08MB103001D43201E2827778B49F83E30@DB5PR08MB1030.eurprd08.prod.outlook.com> <CAEFO=4CV1P23fmb_kAv8u=ubJ5PejVFC59gFGnbNm2TrO-P38Q@mail.gmail.com> <20181019134511.GA1712@gate.crashing.org> <CAEFO=4ApmEcpd-7ou2-_mdvMdGT4qphYdVcuZwpwYD=QvrDOeQ@mail.gmail.com> <DB5PR08MB1030FF50545C033B42839E2B83F90@DB5PR08MB1030.eurprd08.prod.outlook.com> <CAEFO=4CFeyjbRK5itK3ieb5mgEHtcEMSYd70cO4OgtWD2hcjpw@mail.gmail.com> <5b717a08-f994-0de8-5092-d11f5d9f8bd0@redhat.com> <DB5PR08MB1030D79DBDD463F20156413183C40@DB5PR08MB1030.eurprd08.prod.outlook.com>
On Wed, Nov 07, 2018 at 10:34:30PM +0000, Wilco Dijkstra wrote:
> Hi Jeff,
>
> > So if we're going from 0->2 ULPs in some cases, do we want to guard it
> > with one of the various options, if so, which? Giuliano's follow-up
> > will still have the potential for 2ULPs.
>
> The ULP difference is not important since the individual math functions
> already have ULP of 3 or higher. Changing ULP error for some or all inputs
> (like we did with the rewritten math functions) is not considered an issue as
> long as worst-case ULP error doesn't increase.
But the max. error in sinh/cosh/atanh is less than 2 ULP, with some math
libraries. It could be < 1 ULP, in theory, so sinh(atanh(x)) less than
2 ULP even.
> The question is more like whether errno and trapping/exception behaviour
> is identical - I guess it is not so I would expect this to be fastmath only.
> Which particular flag one uses is a detail given there isn't a clear definition
> for most of them.
And signed zeroes. Yeah. I think it would have to be
flag_unsafe_math_optimizations + some more.
Segher