acos-inputs

Siddhesh Poyarekar siddhesh@gotplt.org
Thu Aug 12 08:15:38 GMT 2021


On 8/12/21 1:01 PM, Paul Zimmermann wrote:
> I'm not sure I can, since it would first require to define what are random
> inputs. For acos for example, should they be uniformly distributed in [-1,1],
> or the exponent should be uniformly distributed?

I think what's more important is whether the set of inputs corresponds 
to a distribution that, when improved will result in improvements (not 
necessarily the same amount) in most real workloads.  In the absence of 
a definition for a 'real' workload, we need a way to model some other 
property that typically influences performance.

AFAICT, a uniform distribution of inputs in [-1,1] for acos will neither 
give us a useful enough view of the properties of the algorithm nor that 
of a workload.

> Maybe we could have two workloads for each function: one which would cover
> the different branches of the algorithms (as you did), and one that would
> contain randomly-generated inputs?

The problem with random input generation (as opposed to a single 
pre-computed 'randomized' set of inputs written into a file) is 
reproducibility of the performance.  If you can solve that then a 
dynamically generated set is perfectly fine.

If one had to think in an algorithm-agnostic manner, the one factor that 
typically determines performance of such functions is the precision 
required to compute an accurate result for a given input.  A set of 
inputs such that the precision required to compute f(x) is a uniform 
distribution in the minimum and maximum precision required to compute 
f(x) may tell us more about the performance of the function.

Do you think something like this makes sense?  I don't know if 
performance analysis of libm functions based on precision requirements 
has been done before, so maybe there is literature out there that may 
have dealt with this already.

Siddhesh


More information about the Libc-alpha mailing list