This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Math functions and rounding mode


Joseph Myers wrote:
> 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).

That's great, so the principle already exists. So my suggestion would be to rip out
all the SET_RESTORE_ROUND from exp and see what ULP errors we get for cexp
and others. If unacceptable in non-nearest rounding modes we should just add a
SET_RESTORE_ROUND to those functions and be done with it for this release.

Wilco
    

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]