This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Math functions and rounding mode
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: "patrick dot mcgehearty at oracle dot com" <patrick dot mcgehearty at oracle dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Mon, 1 Jan 2018 14:48:41 +0000
- Subject: Re: Math functions and rounding mode
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0801MB2053D73D0DCF65F8E6CC4AD483180@DB6PR0801MB2053.eurprd08.prod.outlook.com>
On Mon, 1 Jan 2018, Wilco Dijkstra wrote:
> I think we're using the wrong approach here. Assuming exp has acceptable ULP
> errors in all rounding modes (we allow a larger ULP in non-nearest modes),
> we never need to change rounding mode in exp itself. If functions like tgamma
> or cexp end up with errors or unacceptable ULP in non-nearest rounding modes,
> we should simply wrap *those* functions with SET_RESTORE_ROUND.
tgamma already does use SET_RESTORE_ROUND to reduce error accumulation
(and then has code to correct overflowing / underflowing results to be
appropriate for the actual rounding mode).
--
Joseph S. Myers
joseph@codesourcery.com