[PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.

Patrick McGehearty patrick.mcgehearty@oracle.com
Mon Oct 23 19:58:00 GMT 2017


On 10/23/2017 7:47 AM, Joseph Myers wrote:
> On Sat, 21 Oct 2017, Patrick McGehearty wrote:
>
>> On 10/19/2017 5:48 PM, Joseph Myers wrote:
>>> On Thu, 19 Oct 2017, Patrick McGehearty wrote:
>>>
>>>
>>>>> Guaranteeing "inexact" is not part of the goals for most libm functions,
>>>>> so I expect you can remove that term.
>>>> The "inexact" test was required to pass the (make check) math lib tests.
>>> You'll need to explain more.  For functions which are not fully defined by
>>> a binding to IEEE operations, both spurious and missing "inexact" should
>>> be allowed by the testsuite.
>>>
>> When the following lines are commented out:
>>       double force_underflow = tiny * tiny;
>>       math_force_eval (force_underflow);
> That's not what I was referring to.  I was referring to the comment I
> quoted, '/* the "small" term below guarantees inexact will be raised */',
> and the associated uses of the constant "small".  Inexact, not underflow.
>
Now I understand your point and researched the source of the comment and
reason for the use of "small". By my reading of the ieee754 definition 
of "inexact",
exp(x) for any x except 0.0 should set the inexact bit. The Studio version
of exp() included "small" for that reason.
The current Linux ieee754 e_exp() makes no attempt to insure inexact is set.
I can easily match that behavior without changing accuracy by removing all
uses of "small" (and associated comments).

I will do that for my next patch submission.

- patrick



More information about the Libc-alpha mailing list